-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,127
  • 38
  • 103
  • 146

3 Answers3

0
window.location.href = "new URL";
Barmar
  • 669,327
  • 51
  • 454
  • 560
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
  • 43,525
  • 5
  • 33
  • 63
0

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

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