jquery mobile - loadPage issue

后端 未结 1 1909
后悔当初
后悔当初 2021-01-07 01:27

I am having trouble getting jQuery-mobile load page to load my next page into the \"content\" div.

I have cut my page down

相关标签:
1条回答
  • 2021-01-07 01:35

    I don't think You can load a page inside another page, you could try something like this though:

    $(document).on('pageinit', function(){
        $( "#nextPage" ).on( "click", function(){
            $('#containerTest').load('nextPage.html [data-role="content"]',function(){
                $('.ui-page-active').trigger('create');
            });
        });
    });
    

    This will load the content (<div data-role="content">) from page 2 inside the container, then it will trigger the create event on the original page to enhance the loaded content

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