1

I am loading an external page into a div on my jqm page and in order to enhance it with the jQuery mobile styles I call trigge('pagecreate') on the div, this works from the console.

 $('#search-results-page').load('searchResults.php',{options:$.encodeJSON(data.options),search:$.encodeJSON(data.search)},function () {
        $(this).trigger('pagecreate',{options:{}});
        $.mobile.changePage('#search-results-page');
    });

It works if I put my code in a try catch block but if I don't then I get this error:

Uncaught TypeError: Cannot read property 'options' of undefined jquery.mobile-1.3.1.js:7535

4

1 回答 1

10

我收到了这个错误,这是因为我使用的是 jQuery 2.0.0

尝试使用 jQuery 1.9.1

于 2013-05-10T10:42:01.127 回答