Callback Parameters

Callback Parameters

Hi

I want to understand the callback syntax and pass the id of the html element as any parameter

here is my requirement

In my callback, I am passing the load(url..) I want the URL to be dynamic, based on the
URL = BaseURL #callingID , where #callingID is the ID of the calling HTML element.

This way I have to write just one callback function and can reuse this to load multiple sections based on where it is coming from.

Thanks
Rajesh

               

$('#callback').bind('pageAnimationEnd', function(e, info){
                    if (!$(this).data('loaded')) {                      // Make sure the data hasn't already been loaded (we'll set 'loaded' to true a couple lines further down)
                        $(this).append($('<div>Loading</div>').         // Append a placeholder in case the remote HTML takes its sweet time making it back
                            load('peru.html #info', function() {        // Overwrite the "Loading" placeholder text with the remote HTML
                                $(this).parent().data('loaded', true);  // Set the 'loaded' var to true so we know not to re-load the HTML next time the #callback div animation ends
                            }));


Thanks
Rajesh