Jquery Mobile - $(document).ready not firing

后端 未结 2 1189
南笙
南笙 2021-01-19 07:15

So I have a listview in which each component wired to an on click function which looks like this:

function launchNewPage() {
    $.mobile.changePage( \"newPa         


        
相关标签:
2条回答
  • 2021-01-19 07:21

    You cannot start the jQuery mobile with $(document).ready() you should started like this:

    try to work with this in the first HTML

    $("div[data-role*='page']").live('pageshow', function(event, ui) { 
        document.location.href="newPage.html";
    });
    
    0 讨论(0)
  • 2021-01-19 07:29

    Geoff, if you are using the Beta 3 version of the JQM framework, read this. It will help shed light on the DOM and $(document).ready(). You may want to consider the "pagecreate" and "pagebeforecreate" events. They are delineated in the doc referenced in the above link.

    0 讨论(0)
提交回复
热议问题