网上别人的写法。
<head>
<script type="text/javascript">
var iframe;
function load() {
iframe = document.getElementById("iframe");
iframe. onload = iframe. onreadystatechange = iframeload;
iframe.src = "http://www.baidu.com";
}
function iframeload() {
if (!iframe.readyState || iframe.readyState == "complete") {
alert("Local iframe is now loaded.");
}
}
</script>
</head>
<body onload="load()">
<iframe id="iframe"></iframe>
</body>
</html>
我是直接接在Iframe中添加写OnLoad事件,代码如下:
//iframe 加载完成
var iframeLoaded = function (iframe) {
if (iframe.src.length > 0) {
if (!iframe.readyState || iframe.readyState == "complete") {
HideTopWaitPage();
}
}
}
</script>
<iframe id='ifmArrpove' frameborder='0' width='100%' height='100%' onload='iframeLoaded(this)'}></iframe>
网上别人的写法。
<head>
<script type="text/javascript">
var iframe;
function load() {
iframe = document.getElementById("iframe");
iframe. onload = iframe. onreadystatechange = iframeload;
iframe.src = "http://www.baidu.com";
}
function iframeload() {
if (!iframe.readyState || iframe.readyState == "complete") {
alert("Local iframe is now loaded.");
}
}
</script>
</head>
<body onload="load()">
<iframe id="iframe"></iframe>
</body>
</html>
我是直接接在Iframe中添加写OnLoad事件,代码如下:
//iframe 加载完成
var iframeLoaded = function (iframe) {
if (iframe.src.length > 0) {
if (!iframe.readyState || iframe.readyState == "complete") {
HideTopWaitPage();
}
}
}
</script>
<iframe id='ifmArrpove' frameborder='0' width='100%' height='100%' onload='iframeLoaded(this)'}></iframe>