获取地址栏参数

//获取地址栏 参数
function getUrlK(key){
var arr1 = window.location.toString().split('?');
for (var i=1; i<arr1.length; i++) {
var arr2 = arr1[i].split('=');
if ( arr2[0] == key ) {
return decodeURI(arr2[1]);
};
};
};

getUrlK("index");

posted @ 2016-03-10 13:51  duowen  阅读(70)  评论(0编辑  收藏  举报