开发者

How to change page on document ready in jQueryMobile

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜