2017-09-16 114 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文件,所以它不能識別它。我只是扭轉了兩個,錯誤消失

相關問題