2017  Kodetalk | Feedback | Privacy Policy | Terms | About
userimage

Redirect a page using jQuery?

How do I redirect the user from one page to another using jQuery?
userimage

There are two ways by which you can achieve that


If you want to simulate someone clicking on a link, use location.href

Example :

// similar behavior as an HTTP redirect

window.location.replace("http://www.google.com");


 If you want to do an HTTP redirect, use location.replace.

Example :

// similar behavior as clicking on a link

window.location.href = "http://www.google.com";



Answer is