Posted By

vagrantradio on 05/20/11


Tagged

redirect


Versions (?)

jQuery Redirect


 / Published in: jQuery
 

If you want to simulate someone clicking on a link, use location.href. If you want to simulate an HTTP redirect, use location.replace.

  1. // simulates similar behavior as an HTTP redirect
  2. window.location.replace("http://snipplr.com");
  3.  
  4. // simulates similar behavior as clicking on a link
  5. window.location.href = "http://snipplr.com";

Report this snippet  

You need to login to post a comment.