我正在尝试将 MainDisplay 变量附加到名为 searchoutputtable 的 id div 元素
<div id="searchoutputtable">
</div>
这是我用来执行此操作的代码:
$.getJSON(AddressAccess+Build,
function(data)
{
//Do a lot of manipulations to MainDisplay Variable
$('#searchoutputtable').append(MainDisplay);
window.location.href = "#resultssearch";
});
现在每次发生这种情况时,我的 javascript 控制台都会收到以下错误:
Uncaught TypeError: Cannot call method 'not' of undefined
现在,当我 console.log 元素 searchoutputtable 时,我得到了我想要做的事情,它完美地附加了所有内容,唯一的问题是当我们退出 getJson 函数时,我收到该错误,并且我的元素根本不显示。
注意我正在使用 jQueryMobile,是的,我正确加载了库,并且我根本没有在 jQuery 中使用 .not(),所以我不明白他们在上面的错误中指的是什么“not”
最佳答案
使用回流表小部件时,您必须确保使用 <thead>
和<tbody>
使用表格时的标签。因此,在上面的示例中,我的 MainDisplay 变量中有一个标准表,没有 thead 和 tbody 标签,因此出现错误。
关于javascript - JQueryMobile 'not' 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16262484/