简体   繁体   中英

JQueryMobile 'not' error

I'm trying to append the MainDisplay Variable to id div element called searchoutputtable

<div id="searchoutputtable">
</div>

Here is the code I use to do this:

    $.getJSON(AddressAccess+Build,
    function(data)
    {
     //Do a lot of manipulations to MainDisplay Variable
$('#searchoutputtable').append(MainDisplay);
    window.location.href = "#resultssearch";
    });

Now everytime this happends I get the following error in my javascript console:

Uncaught TypeError: Cannot call method 'not' of undefined 

Now when I console.log the element searchoutputtable I get what I am looking to do it appends everything perfectly the only problem is when we exit the getJson function that I get that error and my element isn't displayed at all.

Note I'm using jQueryMobile, yes I load the libraries correctly and I'm not using the .not() in jQuery at all so I'm not understanding what 'not' they are referring to in the error above

When using the reflow table widget you have to definitely make sure that you use the <thead> and <tbody> tags when working with tables. Thus in the above example my MainDisplay variable had a standard table in it without the thead and tbody tags and hence the error.

@GiddyUpHorsey is right. Actullay things are also written on tutorial site of jquery mobile.

Have a look at - http://www.w3schools.com/jquerymobile/jquerymobile_tables.asp

In reflow example it is written in hint area.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM