There is a loading, written in iframe. How can you tell that the page has been loaded?

as shown in the figure,

is written in an iframe.

clipboard.png
how can I tell now that after the content of the page is loaded, I can make the iframe disappear. I wrote window.onload on this page to determine that it doesn"t work. Code:

 var index = layer.load(1, {shade: [0.3, "-sharp393D49"]}); // 
 layer.close(index);// loading
Mar.16,2021
Loading such as

is usually written in ajax.


check constantly with timer,

  1. document: you need to know if the DOM document is loaded.
  2. document.getElementsByTagName and document.getElementById: check the document.getElementsByTagName and document.getElementById functions, and the presence of these functions indicates that DOM has been loaded.
  3. document.body:, as an added bonus, checks to see if the element has been fully loaded. In theory, the previous examination should have been able to make a judgment, but in some cases it is not enough.
Menu