Hello, I’m pretty new in the jQuery world. I'm struggle with the callback function. <script type="text/javascript"> $(document).ready(function(){ $("#gallery-flickr").flickr({api_key: "f28804be7a09c5845676349c7e47d636",per_page: 4 }); $('a').attr({ rel: "prettyPhoto"}); }); </script>
In the first line 4 photos are retrieved from flickr. In the second line rel: "prettyPhoto" has been added to the 4 received photo lines from flickr. This action must perform after all the photo info has been received. It is my understanding that this can be done via the callback function. Albeit I understand the idea behind the callback I do not understand the syntax. What I really want is that the action =>$ ('a').attr({ rel: "prettyPhoto"});<= has been performed when the first action => $("#gallery-flickr").flickr({api_key: "f28804be7a09c5845676349c7e47d636",per_page: 4 });<= has been finished. Any help will appreciated Marinus