获取get请求参数:
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;
}
get请求参数获取中文乱码
function getParam(key){
var lot = location.search;
var reg = new RegExp("." + key + "\s=([^=&#])(?=&|#|).","g");
return decodeURIComponent(lot.replace(reg, "$1"));
};
js对手机号码的校验:
function checkIsTelephone(number) //手机号正则验证
{
return /^1[34578]\d{9}$/g.test(number);
}