获取历史记录。
<input type="button" value="back" οnclick="javascript:history.back(-1);"/>
<input type="button" value="forward" οnclick="javascript:history.forward();"/><input type="button" value="go" οnclick="javascript:history.go(0)"/>
定时器的使用
function myfun(a)
{
var name=a;
return "my name is :"+name;
}
window.setInterval(mufun,2000); //此方法是标准方式
window.setInterval("myfun()",2000); //此方法是标准方法,不推荐使用
locationd对象的属性
window.location.hash="#select";
document.write("书签全称:"+window.location.hash+"<br/>");
document.write("主机全称:"+window.location.host+"<br/>");
document.write("主机名称:"+window.location.hostname+"<br/>");
document.write("路径:"+window.location.pathname+"<br/>");
document.write("连接端口:"+window.location.port+"<br/>");
document.write("通讯协议:"+window.location.protocal+"<br/>");
document.write("查询字符串:"+window.location.search+"<br/>");
遍历navigator对象成员
for(var i in window.navigator){
document.write(i+"==="+window.navigator[i]+"<br/>");
}
自定义架构,使用window.navigator.registerProtocolHandler()方法可以将自己注册注册为特定架构的处理者(此方法仅在火狐适用)
<a href="mailto:1662942665@qq.com">给我发邮件</a>
<script>
window.navigator.registerProtolHandler("mailto","http://localhost/?mail=%s","Mymail");
</script>