Reputation: 2208
Code for Showing Loading indicator while loading content in the inframe 1)When a postback/submit take place in the form inside iframe
Upvotes: 2
Views: 522
Reputation: 342635
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);
Upvotes: 4