码迷,mamicode.com
首页 > 其他好文 > 详细

获取地址栏参数

时间:2018-05-18 16:49:20      阅读:124      评论:0      收藏:0      [点我收藏+]

标签:ring   func   substr   location   amp   null   regexp   cti   turn   

/*获取地址栏参数*/
GetQueryString = function(name){
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) return decodeURI(r[2]); return null;
}

获取地址栏参数

标签:ring   func   substr   location   amp   null   regexp   cti   turn   

原文地址:https://www.cnblogs.com/lucy1111/p/9056837.html

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