Home >Web Front-end >HTML Tutorial >How to implement html nested iframe to wait for the iframe page to load before calling the next step_html/css_WEB-ITnose
如果想在你的html里面显示一张图片,或者显示一个报表,经常会在里面嵌套iframe,当我们点查询报表时,在报表显示过程中,我们想做个遮罩层,提示等待...但是报表显示出来后,我们如何把遮罩层去掉,让报表更好的展示呢?
我就用代码来解释一个例子吧:
<div align="left" style="height: 100%" id ="benefitnotice_report"> <iframe id="benefitnotice_iframe" width="100%" height="90%" frameborder="0" > </iframe></div>
The js that sends the url to display the report is as follows:
var id ="#benefitnotice_report"; showWaiting('正在加载报表' , null, id);//遮罩层调用 src=src+"&aic1621="+aic1621+"&aic1622="+aic1622+"&aae140="+aae140+"&aaf101="+aaf101+"&aaz070="+aaz070+"&aac031="+aac031; $("#benefitnotice_iframe").attr("src",src);After the report is displayed, remove the mask layer:
$("#benefitnotice_iframe").load(function(){ closeWaiting("#benefitnotice_report"); });