Redirect Using jQuery

Posted by tshauck on Stack Overflow See other posts from Stack Overflow or by tshauck
Published on 2011-01-06T03:37:30Z Indexed on 2011/01/06 3:54 UTC
Read the original article Hit count: 143

Filed under:
|

Hi,

So I'm using jquerymobile for an app I'm creating. I have a link that if all the validation passes I'd like to go through, but if something fails I'd like to redirect.

In the jquery something like this. Since it is jquerymobile the link will be a new div on the same index.html page - if that helps.

$(#link).click(function(){  
  if(validation_fails) link_elsewhere;  
  else return true;
}

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about mobile