https://github.com/lianbinghua

js获取url的参数值

var match = new RegExp('[?&]voucherSn=([^&]*)').exec("http://m.v3beta.tootoo.cn/index.php?r=TExchange/exchangeArea?voucherSn=123");
var voucherSn= JSON.parse(match && decodeURIComponent(match[1].replace(/\+/g, ' ')));

posted @ 2015-11-06 16:24  连冰华  阅读(104)  评论(0编辑  收藏  举报