-2

Instead of using the window.open command in javascript -- which only creates a pop-up window -- how would someone use javascript to reassign the URL to a completely new area?

xarzu
  • 8,657
  • 40
  • 108
  • 160

3 Answers3

0
window.location.href = "new URL";
Barmar
  • 741,623
  • 53
  • 500
  • 612
0

How about window.location.href = 'http://www.google.com'; //Will take you to Google. See this write up http://davidwalsh.name/javascript-window-location

Scary Wombat
  • 44,617
  • 6
  • 35
  • 64
0

or if you don't want the current page in the browser history, use

window.location.replace("New URL");
EJK
  • 12,332
  • 3
  • 38
  • 55