How to get Anchor Links to work in Jquery Mobile?

后端 未结 7 2286
情书的邮戳
情书的邮戳 2020-12-08 20:47

Jquery Mobile has decided to treat anchor links as page requests of sort. However, this isn\'t good if you have a load of blog posts which have anchor links to the same page

7条回答
  •  忘掉有多难
    2020-12-08 21:26

    You could try adding a data-ajax="false" on the anchor tag.

    Linking without Ajax

    Links that point to other domains or that have rel="external", data-ajax="false" or target attributes will not be loaded with Ajax. Instead, these links will cause a full page refresh with no animated transition. Both attributes (rel="external" and data-ajax="false") have the same effect, but a different semantic meaning: rel="external" should be used when linking to another site or domain, while data-ajax="false" is useful for simply opting a page within your domain from being loaded via Ajax. Because of security restrictions, the framework always opts links to external domains out of the Ajax behavior.

    Reference - http://jquerymobile.com/demos/1.0.1/docs/pages/page-links.html

提交回复
热议问题