Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redirect Using jQuery [duplicate]

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; } 
like image 417
tshauck Avatar asked Jan 06 '11 03:01

tshauck


1 Answers

You can use the window.location to redirect a browser:

https://developer.mozilla.org/en/DOM/window.location

like image 173
Razor Storm Avatar answered Sep 20 '22 15:09

Razor Storm