jQuery Redirect


/ Published in: jQuery
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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


Comments


You need to login to view comments.