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");
  4. // simulates similar behavior as clicking on a link
  5. window.location.href = "http://snipplr.com";

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.