function getUrlParams(params){
var urlObj = {};
if(!window.location.search){return false;}
var urlParams = window.location.search.substring(1);
var urlArr = urlParams.split('&');
for(var i = 0; i < urlArr.length; i++){
var urlArrItem = urlArr[i].split('=');
urlObj[urlArrItem[0]] = urlArrItem[1]
}
// 判斷是否有參數
if(arguments.length>=1){
return urlObj[params]
}
return urlObj;
}
getUrlParams().ie;
getUrlParams('ie');
GetQueryString(param) { //param為要獲取的參數名 注:獲取不到是為null
var currentUrl = window.location.href; //獲取當前鏈接
var arr = currentUrl.split("?");//分割域名和參數界限
if (arr.length > 1) {
arr = arr[1].split("&");//分割參數
for (var i = 0; i < arr.length; i++) {
var tem = arr[i].split("="); //分割參數名和參數內容
if (tem[0] == param) {
return tem[1];
}
}
return null;
}
else {
return null;
}
},