About the onload event of IFRAME

    I encountered a problem about iframes yesterday. For example, an iframe is embedded in a page called a_iframe. If the attribute setting is directly added to the label of a_iframe, onload='', only the onload event will work. Online After inquiring, the specific reason is unknown, but there is a solution: 

        1: Process through the onreadystatechange event of the iframe

        2: Bind events to the iframe through the attachEvent method in IE

    Only in this way can the onload event be truly bound to the corresponding iframe.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325014670&siteId=291194637