Everything in the event loaded by the IFrame

Is there any event for IFrames that fires only when each resource is loaded (script, image, style sheet, dom)? Basically, I want to have loading graphics displayed above the IFrame, and delete it only when everything loads inside, so the user does not see all the downloads.

I am currently using $(iframe).ready(function() { ... });, but it works very early before anything loads.

+3
source share
1 answer

You are looking for an event window.onload.

window.onload , - (, iFrames ..) , . .

$(window).load(function(){
   alert('fired');
});

-JQuery

window.onload = function(){
   alert('fired');
};
+5

Source: https://habr.com/ru/post/1758164/


All Articles