JQuery mobile handling links (return false)
Posted
by
shinax
on Stack Overflow
See other posts from Stack Overflow
or by shinax
Published on 2013-07-01T22:53:28Z
Indexed on
2013/07/03
5:05 UTC
Read the original article
Hit count: 98
I'm planning on using JQM to make a simple mobile web app, and I'm having problems getting this simple functionality to work: when I click on some links (not all of them), I want to be able to first process some data, and then depending on that outcome, sometimes continue the link action (I like the whole transitions and ajax things), and sometimes don't.
The important part is that I want to preserve the normal JQMobile transitions and stuff for the links, just sometimes prevent them (for example for validation and things like that).
I've tried with: return false, preventDefault (and in combination with stopPropagation), and data-ajax="false", and none hav worked, they all redirect.
Could somebody tell me the correct way to to this in JQMobile? Just in case it's important: I'm using anchor links, using this to test.
Thank you in advance, Jennifer.
© Stack Overflow or respective owner