brooklyndesignstudio

Page URL Redirection

Jan 13th, 2021
648
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Sets the new location of the current window.
  2. window.location = "https://www.example.com";
  3.  
  4. // Sets the new href (URL) for the current window.
  5. window.location.href = "https://www.example.com";
  6.  
  7. // Assigns a new URL to the current window.
  8. window.location.assign("https://www.example.com");
  9.  
  10. // Replaces the location of the current window with the new one.
  11. window.location.replace("https://www.example.com");
  12.  
  13. // Sets the location of the current window itself.
  14. self.location = "https://www.example.com";
  15.  
  16. // Sets the location of the topmost window of the current window.
  17. top.location = "https://www.example.com";
RAW Paste Data