首页 > 代码库 > js_截取Url值

js_截取Url值

 

"total" -->传递参数时的名字

var reg = new RegExp("(^|&)" + "total" + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
$("#score").append(r[2]);

js_截取Url值