function getArgs(){
if(location.search == ''){
return 'nonono';
}
var qs = location.search.substr(1);
var args = {};//保存参数,
var items = qs.split("&");//取得每一项
var item=null,name=null,value=null;
for(var i=0;i<items.length;i++){
item=items[i].split("=");
name = decodeURIComponent(item[0]);//url解码
value = decodeURIComponent(item[1]);
args[name] = value;
}
return args;
}
alert(getArgs());
location.assign("http://qq.com");
location.href = 'http://qq.com';
location = 'http://qq.com';//这三个都是修改当前页面
location.hash = 'haha';
location.search='id=1001';
等等
location.reload();//重新加载(有可能从缓存加载)
location.reload(true);//重新加载(从服务器加载)
location.replace('url'); //将当前页面改为url指向的页面