location对象
hash
host
hostname
href
pathname
port
protocol
search
解析查询字符串
function query(){
var qs =location.search.length>0 ? location.search.substring(1):'',
args = [],
items = qs.length?qs.split('&'):[],
item = null,
name = null,
value = null,
i=0,
len=items.length;
for(i=0;i<len;i++){
item =items[i].split('=');
name =decodeURIComponent(item[0]);
value =decodeURIComponent(item[1]);
if(name.length){
args[name]=value;
}
}
return args;
}
location.replace()用户不能回到前一个页面
history对象
go()
forward()
back()
history.length