2017-09-16 71 views
0

我有一个<div id="tguide">我用作占位符。我被告知iframes不如jquery加载。所以这是我:

'$(窗口)。在(“负载大小调整”,功能(E){jQuery innerHTML无法设置属性

var transferguidelocation = "../" 
    var title = $(document).attr('title'); 
    if(title == 'System Manuals') { 
     var transferguidelocation = "../SystemManuals/" 
    }; 
document.getElementById("tguide").innerHTML='<object type="text/html" data="' + transferguidelocation + 'shared/TransferGuide.html" style="width:100%;height:100%;"></object>'; 

正如你可以先它检查看它在哪个页面,然后将其添加一个额外的文件夹位置到TransferGuide.html位置

该文件加载到<div>没有问题,它看起来正是我想要它的方式和数据是正确的,问题是,我在下面的错误浏览器检查员:

enter image description here

这有点烦人,我不是错误的粉丝。有谁知道我能如何摆脱这个?

+0

可能重复[为什么jQuery或DOM方法如getElementById找不到元素?](https://stackoverflow.com/questions/14028959/why-does- jquery-or-a-dom-method-such-as-getelementbyid-not-find-the-element) – ASpirin

+0

我想通了。我在js.min文件之前引用了我的custom.js文件,所以它不能识别它。我只是扭转了两个,错误消失了。 – Chester

回答

0

我想通了。我在js.min文件之前引用了我的custom.js文件,所以它不能识别它。我只是扭转了两个,错误消失

相关问题