1

我尝试使用以下代码来监听 IE8 中的 iframe onload 事件

            aliJob.init(data)
            aliJob.openIframe()
            alert(aliJob.ifr)
            if(aliJob.ifr.attachEvent){
                aliJob.ifr.attachEvent('onload',function(){


                    alert("before init")

                    aliJob.ifr.contentWindow.DefaultjobList.jsonInit()


                    aliJob.ifr.contentWindow.document.getElementById("markText").getElementsByTagName("span")[0].onclick=aliJob.closeIframe

                })
            }
            else{
                aliJob.ifr.onload=function(){

                    //some other code


            }

obj 是可访问的aliJob.ifr,因为它可以在 IE8 中发出警报

但是,两种方式都无法监听 iframe onload,

其他浏览器没问题

有人可以对此有所了解吗?

4

0 回答 0