Javascript 更改查询字符串参数
应该是怎样的Javascript 更改查询字符串参数,javascript,jquery,Javascript,Jquery,应该是怎样的 var text = $(this).siblings("[type=text]").val(); document.location = "Default.aspx" + "?id=" + text + "&type=" + query; 属性的名称是window.location,而不是document.location。此外,您可能希望使用encodeURIComponent对其中一个(或两个)值进行转义 window.location = "Default.asp
var text = $(this).siblings("[type=text]").val();
document.location = "Default.aspx" + "?id=" + text + "&type=" + query;
属性的名称是
window.location
,而不是document.location
。此外,您可能希望使用encodeURIComponent
对其中一个(或两个)值进行转义
window.location = "Default.aspx" +
"?id=" + encodeURIComponent(text) +
"&type=" + encodeURIComponent(query);
window.location=“Default.aspx”+
“?id=“+encodeURIComponent(文本)+
“&type=“+encodeURIComponent(查询)代码>你想完成什么?请告诉我们结果需要是什么以及HTML是什么样子。。。