iframe加载问题 [英] Iframe loading problem

查看:125
本文介绍了iframe加载问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何知道iframe是completeley加载的还是不是以编程方式加载的?
在mypage中有一个iframe ...,在运行时,我将设置此iframe的src属性,在加载iframe之后,我要设置此iframe的高度和宽度,然后使用jquery将其打开到jdialog中...

代码看起来像这样...

How to know iframe is completeley loaded or not programtically?
There is one iframe in mypage...,at runtime i will set src attribute of this iframe , after iframe loaded i want to set height and width of this iframe and then open that iframe in to jdialog using jquery...

code look like this...

<script type="javascript">
           function ShowDialog() {
           $("#ifrmmodify").attr("src","Default2.aspx");
            //here after this page load completely in iframe i want to set height and width of this iframe.then
          $("#dvmodify").dialog();
       }
</script>
<form>
<div id="dvmodify">
            
           <iframe id="ifrmmodify"/>

</div>
</form>

推荐答案

(#ifrmmodify").attr("src","Default2.aspx"); //在此页面完全加载到iframe中之后,我要设置此iframe的高度和宽度.然后
("#ifrmmodify").attr("src","Default2.aspx"); //here after this page load completely in iframe i want to set height and width of this iframe.then


(#dvmodify").dialog(); } </script> < form> < div id ="dvmodify"> < iframe id ="ifrmmodify"/> </div> </form>
("#dvmodify").dialog(); } </script> <form> <div id="dvmodify"> <iframe id="ifrmmodify"/> </div> </form>


使用您的iframe事件onload.
只是一个示例: http://www.w3schools.com/jsref/event_frame_onload.asp [ ^ ].
Use event onload of your iframe.
Just one example: http://www.w3schools.com/jsref/event_frame_onload.asp[^].


这篇关于iframe加载问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆