How to redirect page using JavaScript

Today i have a requirement to redirect page to another on the basis of the some condition using the scripting and i use the windows.location.href. There are others method to redirect the page: you can use the windows.location.href= and windows.location.replace() .

You can use windows.location.href= and windows.location.replace() methods also to redirect to other page like these:

 
window.location.href = "http://www.authorcode.com";
//or
window.location.replace("http://www.authorcode.com");

The main difference between href and replace() method, is that replace() removes the URL of the current document from the document history,that means you can’t navigate the current document using the history.back(). But if you use the location.href= you can load navigate back to the original document. This works same as clicking on a link.

You can redirect the page to another using jQuery just like as:

$(location).attr('href','http://www.authorcode.com');

Thanks