可能重复:
How can I get a specific parameter from location.search?如何从javascript中的url获取参数值?
我有类似下面的网址。
http://localhost/xxx.php?tPath=&pid=37
我想要得到的PID = 37,但它的名字,因为对时间的网址是像上面,然后当刷新页面,则URL变成像下面这样。
http://localhost/xxx.php?tPath=&action=xxx&pid=37&value=13&fname=aaaa&fone=4321122
所以我想获得pid = 37。它可能是一个函数,我将pid作为参数传递给它,并返回它的值。
我该怎么做?
看到这个答案:http://stackoverflow.com/questions/901115/get-query-string-values-in-javascript/2880929#2880929 – 2012-03-15 11:25:42
这个职位的回答可以帮助你。 http://stackoverflow.com/questions/979975/how-to-get-the-value-from-url-parameter – matheusvmbruno 2012-03-15 11:27:36