js 判断iframe是否加载完毕
1.javascript实现
window.onload = function () { var iframe = document.getElementById( "myframe" ) if (iframe.attachEvent) { // IE iframe.attachEvent( "onload" , function () { alert( "iframe加载完毕!" ); }); } else { // 非IE iframe.onload = function () { alert( "iframe加载完毕!" ); }; } }
2.jquery实现
$( function () { // iframe加载完毕 $( "#myframe" ).load( function () { alert( "iframe加载完毕!" ); }); });
本文来自博客园,作者:Marydon,转载请注明原文链接:https://www.cnblogs.com/Marydon20170307/p/9640921.html