history对象
history对象 记录用户访问的url
go back forward
案例<html> <head>
<script type="text/javascript">
function myback()
{
//window.alert('ok');
//window.history.back();
window.alert(history.length);
window.history.go(-1);
}
</script> </head>
<h1>b.html</h1>
<input type="button" οnclick="myback()" value="返回上一次页面1"/>
</html>
location对象
location对象包含当前url的信息
① reload方法
重新加载本页面(刷新本页面)
<script>
function myfresh()
{
window.location.reload();// ajax局部刷新
}
//每隔十秒刷新页面
window.setInterval("myfresh()",10000);
</script>
② href属性
通过该属性可以指定 载入新的页面
window.location.href="url" //url可以本网址,也可以另一个网址
navigator
该对象包括浏览器的信息
想看该对象下的所有属性可以通过遍历获得。
<script type="text/javascript">
for (var key in navigator )
{document.write("<br/>"+key+"="+navigator[key]); }
</script>