Using jQuery Mobile I would like to disable the ajax call on links within a specific part of the DOM.
I do not want to put a
data-ajax = false
every time I don’t want to use the jquerymobile ajax.
For example, any link that is a child of ‘content’:
<div class="content">
<a href="http://externalwebsite.com">External Link</a>
</div>
I would like to add the ‘data-ajax = false’ onto every link that is a child of ‘content’
Is there a way to do this with jquery?
If you want to disable the ajax link behaviour from an anchor tag, you can put
rel=externalin the link and the link will load without ajax and your url will then be usual.http://jquerymobile.com/demos/1.0a4.1/#docs/pages/docs-navmodel.html
If you want to do this in jQuery for some a tags inside content div, you may try like this
Here is a sample http://jsfiddle.net/4WEBk/3/
The more Simplified version. (Thanks to tandu for pointing )