首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在IE8 - IE9中完全加载iframe内容

在IE8 - IE9中完全加载iframe内容
EN

Stack Overflow用户
提问于 2013-09-16 17:03:23
回答 1查看 252关注 0票数 0

我在IE8-9中有一个页面全加载的问题。我想在div内容完全加载后执行一些操作,但在IE8-9中,页面没有完全加载。此外,该操作不能正常工作,因为它应该对加载的内容执行一些操作。

下面是我的代码的一小部分。我正在尝试访问iframe内容并在iframe完全加载时更改样式:

代码语言:javascript
复制
$('#simulator_content').load(function(){
  if($('.edit-but').hasClass('edit_css_click')){
     $('#simulator_content').contents().find('#inner__wp_cincopa_1').find('style').html($("#_skin_css_new").val());
    }
});  
EN

回答 1

Stack Overflow用户

发布于 2013-09-16 17:17:50

代码语言:javascript
复制
// there might be any third party image / request that's why it taking so much time to load
// here is an alternate way to do that thing
// check selector ID name with closest one

function reCheckElem(){
    if($("#simulator_content").length>0){
        // now element is loaded / available to modify
        alert("Element is ready to modify!!");
    } else { 
        setTimeout(function(){
            reCheckElem(); // wait 0.5 second and check in again
        },500);
    }
}

// call it when page start loading
reCheckElem();
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18824129

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档