0

我想在 URL 中动态添加查询字符串,这怎么可能在客户端。我可以通过 location.href 和 response.redirect 来处理它,但我不想这样做

谢谢

4

3 回答 3

0

您可以使用jQuery BBQ库,特别是jQuery.param.queryString方法。

于 2012-05-18T06:36:46.493 回答
0

如果要在 URL 中显示过滤,则必须使用 location.href,例如:

location.href = "yourpage.aspx?filter1=" + val

但是如果显示过滤不是必需的,那么您可以发送 JSON 调用并向用户显示过滤后的数据。

于 2012-05-18T06:49:07.647 回答
0
$(document).ready(function () {
    $('a.TestClass').attr(function () {
        return $(this).href() + '?test1=a&test2=b';
    });
});
于 2012-05-18T06:41:20.397 回答