16 August 2011

There are many ways of doing redirect in JavaScript this should be the standard implementation for changing the current window's location.

Source code viewer
  1. // Similar behavior as clicking on a link.
  2. window.location.href = 'http://browse-tutorials.com';
  3.  
  4. // Similar behavior as a HTTP redirect.
  5. window.location.replace('http://browse-tutorials.com');
Programming Language: Javascript