javascript - JQueryMobile 'not' 错误

标签 javascript jquery jquery-mobile

我正在尝试将 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/

相关文章:

javascript - Jasmine spy : How to make it work when the spyed function reference is passed?

javascript - 在不加载新页面的情况下更改 url

jquery - 使用 jQuery 更改 Div 颜色的问题

jquery - NiceScroll JQuery 插件可以自动滚动吗?

javascript - 检测有多少 div 超出窗口高度

css - jquerymobile 缩略图垂直对齐与长描述

django - 使用 jQuery Mobile、Django 和 Phonegap 构建移动应用程序

javascript - JQuery BorderRadius 在 mouseout 中不执行动画

javascript - 在 JavaScript 中向原型(prototype)对象添加方法

javascript - 如何将参数传递给 PhoneGap 数据库事务函数