views:

126

answers:

1

Code for Showing Loading indicator while loading content in the inframe 1)When a postback/submit take place in the form inside iframe

+1  A: 

You can bind to the ajaxStart and ajaxStop global (ajax) events as follows:

$("#loading").bind("ajaxStart", function(){
    $(this).fadeIn("slow");
}).bind("ajaxStop", function(){
    $(this).fadeOut("slow");
});

assuming loading is the ID of your loading indicator div/span.

If you want a prettier solution, take a look at the awesome blockUI plugin. The equivalent of the above using blockUI:

$().ajaxStart($.blockUI)
   .ajaxStop($.unblockUI);
karim79