<BODY>
<!-- 此处div用做loading效果 -->
<div id="frameprogrssBar" align="center">
<img src="http://sc.cnwebshow.com/upimg/allimg/070707/01294420.gif" /> loading...
</div>
<!--iframe属性src中放入需要加载的页面或页面路径-->
<iframe id="framecontent" src=http://hi.baidu.com/java513 width="100%" height="100%" frameborder="0" scrolling="no" marginheight="0">
</iframe>
<script type="text/javascript">
startload(document.getElementById("frameprogrssBar"),document.getElementById("framecontent"))
function startload(loadstr,iframestr){
var loadstr=loadstr;
var iframestr=iframestr;
loadstr.style.display ="block";//显示进度条
iframestr.style.display ="none";//隐藏 数据
if (window.ActiveXObject){
iframestr.onreadystatechange=function (){
if(this.readyState=="complete"){// 解释:一个iframe加载完毕的状态是complete,就象xmlhttp里的那个==4一样,这些都是规定的
loadstr.innerHTML="load complete!";
loadstr.style.display="none";
iframestr.style.display="block";
}
}
}else{
iframestr.style.display ="block";//隐藏
loadstr.style.display ="none";//显示
}
}
</script>
</BODY>
转载于:https://my.oschina.net/u/1035715/blog/223915