首页 > 其他 > 详细

BOM之其他浏览器对象的使用

时间:2018-06-13 10:13:02      阅读:162      评论:0      收藏:0      [点我收藏+]
BOM History
History 对象包含用户(在浏览器窗口中)访问过的 URL
back()  加载 history 列表中的前一个 URL
forward()  加载 history 列表中的下一个 URL
go()  加载 history 列表中的某个具体页面

<!--
BOM Navigater
BOM Screen
BOM History
BOM Location
-->
<script type="text/javascript">
        document.write(navigator.platform+","+navigator.systemLanguage+","+navigator.cpuClass+"<br/>");
        document.write(screen.height+","+screen.width+"<br/>");

        function next(){
                //history.forward();
                history.go(1);   //后退-1;
        }
        function previous(){  //要事先写个跳转页面到这个页面
                history.back();
        }
        document.write(location.href+"----"+location.protocol+"<br/>");
</script>
<input type="button" onclick="next()" value="前进">
<input type="button" onclick="previous()" value="后退">
<a href="http://www.baidu.com">百度</a>

技术分享图片














BOM之其他浏览器对象的使用

原文:https://www.cnblogs.com/meihao1203/p/9176064.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!