Description
获取location.search转化成object进行返回
function locationObj(){
var _args = {};
var _href = location.search.substring(1);
var _hrefArray = _href.split('&');
for (var i = 0; i < _hrefArray.length; i++) {
var _pos = _hrefArray[i].indexOf('=');
if (_pos == -1) {
continue;
}else{
var _name = _hrefArray[i].substring(0,_pos);
var _value = _hrefArray[i].substring(_pos+1);
/*_value = decodeURIComponent(_value);*/ //进行转译
_args[_name] = _value;
}
}
return _args;
}