此功能是否正确?
答
不,这不是正确的
。alert(window.location.href + "&name=" + encodeURIComponent(name_var) + "&id=" + encodeURIComponent(id_var));
- 您在代码中有一个语法错误,
/
遵循window.location.href
- 使用连接运算符,
+
-myString + "more string"
-
escape
已过时,使用encodeURI()
和encodeURIComponent()
'encodeURIComponent'。 – bobince 2010-06-23 12:12:29
@bobince:该死的,我一直在困惑他们! – 2010-06-23 12:14:49