开发者

How to change page on document ready in jQueryMobile

开发者 https://www.devze.com 2023-03-16 01:54 出处:网络
I\'m trying to change page on document ready $.mobile.changePage(\'#loginPage\'); but it throws a 404 error:

I'm trying to change page on document ready

$.mobile.changePage('#loginPage');

but it throws a 404 error:

"NetworkError: 404 Not Found - http://localhost/mBanka/v5/log开发者_如何转开发inPage"


Look into jQM events http://jquerymobile.com/demos/1.0b1/#/demos/1.0b1/docs/api/events.html

$('div').live('pageshow',function(event, ui){
  alert('This page was just hidden: '+ ui.prevPage);
});


It looks like an example of not reading the docs carefully. :)

You need to pass a jQuery object if referencing page in the same document. This should work.

$.mobile.changePage($('#loginPage'));

If not - put more info in your question

0

精彩评论

暂无评论...
验证码 换一张
取 消