2013-04-28 71 views
0

它应该如何?更改查询字符串参数

var text = $(this).siblings("[type=text]").val(); 
document.location = "Default.aspx" + "?id=" + text + "&type=" + query; 
+0

你想完成什么?请告诉我们结果需要什么以及HTML的样子是什么...... – 2013-04-28 13:19:07

回答

2

属性的名称为window.location,不document.location。另外,您可能需要使用encodeURIComponent来转义这些值中的一个(或两个)。

window.location = "Default.aspx" + 
    "?id=" + encodeURIComponent(text) + 
    "&type=" + encodeURIComponent(query);