2009-12-06 211 views

回答

13

无关jQuery的,只是这样的:

window.location.href = 'whatever.html'; 
4

(普通老式的JavaScript)

window.location = 'http://another-place.com'; 
+2

人们学习jQuery的现在,而不是JavaScript的。 – 2009-12-06 04:09:36

+1

@BipedalShark大声笑。没错,但是由于jQuery没有办法做到这一点,我认为他们有时候必须走出jQuery世界(就像我承认的那样痛苦)。 :) – 2009-12-06 04:17:39

+0

@Darrell,我想'$(window).attr(“location”,“http://another.com”)'可能会工作..但是多么浪费函数调用......哈哈! – 2009-12-06 04:23:32