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

js查询参数

时间:2018-03-02 12:26:41      阅读:130      评论:0      收藏:0      [点我收藏+]

标签:regex   nes   amp   str   var   window   sub   cape   col   

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

查询参数

js查询参数

标签:regex   nes   amp   str   var   window   sub   cape   col   

原文地址:https://www.cnblogs.com/AttackLion/p/8492108.html

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