所有浏览器的window.href

时间:2009-10-08 11:36:42

标签: javascript cross-browser

如何为firefox和IE支持替换window.href = "someurlhtml"

3 个答案:

答案 0 :(得分:46)

window.location.href = "someurl";

答案 1 :(得分:11)

您使用位置对象:

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

或者只是

location.href = 'some.html';

答案 2 :(得分:-3)

您也可以这样做:

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

 document.location = "some.html";