jQuery innerHTML 无法设置 属性
jQuery innerHTML cannot set property
我有一个 <div id="tguide">
用作占位符。有人告诉我 iframe 不如 jquery 负载。所以这就是我所拥有的:
`$(window).on('load resize',function(e){
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>
没问题,它看起来正是我想要的方式并且数据是正确的,问题是我在浏览器检查器中收到以下错误:
这有点烦人,我不喜欢这些错误。有谁知道我怎样才能摆脱这个?
我想通了。我在 js.min 文件之前引用了我的 custom.js 文件,因此它无法识别它。我只是颠倒了两者,错误就消失了
我有一个 <div id="tguide">
用作占位符。有人告诉我 iframe 不如 jquery 负载。所以这就是我所拥有的:
`$(window).on('load resize',function(e){
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>
没问题,它看起来正是我想要的方式并且数据是正确的,问题是我在浏览器检查器中收到以下错误:
这有点烦人,我不喜欢这些错误。有谁知道我怎样才能摆脱这个?
我想通了。我在 js.min 文件之前引用了我的 custom.js 文件,因此它无法识别它。我只是颠倒了两者,错误就消失了