alert(window.location.href /& name =“+ escape(name_var)+”& id =“+ escape(id_var));
谢谢
答案 0 :(得分:2)
不,这不正确。
alert(window.location.href + "&name=" + encodeURIComponent(name_var) + "&id=" + encodeURIComponent(id_var));
/
window.location.href
+
- myString + "more string"
escape
已弃用,请使用encodeURI()
和encodeURIComponent()