Javascript 如何使用mootools检索当前查询字符串值

Javascript 如何使用mootools检索当前查询字符串值,javascript,ajax,mootools,Javascript,Ajax,Mootools,如何使用mootools检索当前查询字符串值 我正在使用mootools ajax进行php分页。以下参数将与我的第一个调用一起传递 format=html&nolayout=true&p[0]=1000-1500&p[1]=1500-2000&p[2]=2000-2500 对于第二个ajax调用,应该保留上述所有参数,并需要附加一个参数,如下所示 format=html&nolayout=true&p[0]=1000-1500&p[1]

如何使用mootools检索当前查询字符串值

我正在使用mootools ajax进行php分页。以下参数将与我的第一个调用一起传递

format=html&nolayout=true&p[0]=1000-1500&p[1]=1500-2000&p[2]=2000-2500
对于第二个ajax调用,应该保留上述所有参数,并需要附加一个参数,如下所示

format=html&nolayout=true&p[0]=1000-1500&p[1]=1500-2000&p[2]=2000-2500&pagenum=1
如何做到这一点。请提供任何帮助

您只需使用即可

获取当前QS并删除第一个字符
,以及
&pagenum=X
(+),然后附加新参数并发送ajax请求

var currQueryString = window.location.search.substring(1), //and also remove '&pagenum=X' (see above)
    newQueryString = currQueryString + "&pagenum=1"; //obv, pagenum should be dynamic, this is just an example

new Request({ //or Request.HTML...
  url : 'http://some/url' // ...and other options
}).send(newQueryString);