码迷,mamicode.com
首页 > Web开发 > 详细

jQuery正则获取链接参数

时间:2017-09-28 20:41:45      阅读:154      评论:0      收藏:0      [点我收藏+]

标签:sub   nbsp   color   ring   blog   amp   exp   search   jquer   

function GetQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]); return null;
}

 

jQuery正则获取链接参数

标签:sub   nbsp   color   ring   blog   amp   exp   search   jquer   

原文地址:http://www.cnblogs.com/rookie-q/p/7608198.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!