开发者

jquery mobile alpha 3 links to pages don't work now

In alpha 2 of jquery mobile, I had this (in test.html):

in the url/address bar it shows this: test.html#pg-one which makes sense. since I clicked a dialog link.

<div data-role="page" id="pg-one">
<a 开发者_如何学Chref="test2.html">Row 1<span>test</span></a>
</div>

Which loads test2.html I can use a back button to get back to test.html

However now in jquery alpha 3, when I click the link it tries to access this address:

pg-onetest2.html

???

It seems to be prepending the id of the container div?


Matt,

This is correct behaviour. jQuery Mobile has the ability to create 'multi-page templates' by stacking multiple divs with a data-role of "page". Each 'page' block needs a unique ID that will be used to link internally between 'pages'. When a link is clicked, the framework will look for an internal 'page' with the ID and transition it into view. jQuery Mobile uses the hash in combination with the ID to track navigation history for all the Ajax 'pages'.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜