2009-10-08 60 views

回答

45
window.location.href = "someurl"; 
11

您可以使用位置對象:

window.location.href = 'some.html'; 

或者乾脆

location.href = 'some.html'; 
-3

你也可以做這樣的事情:

document.location.href = "some.html"; 

document.location = "some.html"; 
+19

在Netscape Navigator 3發佈的時候,document.location在1996年左右的時候被棄用,取而代之的是window.location。 – NickFitz 2009-10-08 14:22:58