javascript BOM对象 第15节
2015-08-19 13:38
651 查看
<html> <head> <title>浏览器对象</title> <script type="text/javascript"> var a = 20;//声明变量 函数 对象 属于window对象 //alert(window.a); function test () { alert("window对象函数"); } //window.test();//函数调用 </script> </head> <body> <div>BOM对象</div> 1.navigator<br/> <script type="text/javascript"> for ( var name in navigator ) { document.write(name ," : " ,navigator[name], "<br/>"); } </script> 2.screen<br/> <script type="text/javascript"> for ( var name in screen ) { document.write(name ," : " , screen[name], "<br/>"); } </script> 3.history<br/> <script type="text/javascript"> </script> <a href="浏览器对象.htm" target="_self">浏览器对象</a> <input type="button" value="向前" onclick="history.forward()"/><br/> 4.location<br/> <script type="text/javascript"> document.write("location.host : ", location.host, "<br/>"); document.write("随机数 : ", Math.round(Math.random() * 100), "<br/>"); </script> <input type="button" value="换页1" onclick="location.href='浏览器对象.htm'"/> <input type="button" value="换页2" onclick="location='浏览器对象.htm'"/> <input type="button" value="刷新" onclick="location.reload()"/> <input type="button" value="替换" onclick="location.replace('内置对象.htm')"/> <input type="button" value="转向" onclick="location.assign('内置对象.htm')"/> </body> </html>
rs:
![](http://images0.cnblogs.com/blog2015/723037/201508/191337052697419.png)
2.
![](http://images0.cnblogs.com/blog2015/723037/201508/191337438168062.png)
相关文章推荐
- js字符转处理
- js_图片放大镜
- js基础精华01
- JS简单实现城市二级联动选择插件的方法
- json解析库的使用
- js实现当前输入框高亮显示的方法
- js的一些琐碎
- JavaScript中解决多浏览器兼容性问题的方案
- EXT.JS初学配置
- JSP页面使用JSTL日期对比
- JavaScript 实现跨域的常用方法
- json数据的处理
- 用jsmooth + inno生成exe并制作简单安装包
- 有方向的运动js
- JS实现仿新浪微博发布内容为空时提示功能代码
- 我在工作中遇到的JS问题汇总
- SPFA,dijskra,prime,topu四种算法的模板
- QSettings的Json格式支持
- Extjs初学入门,详细panel、form、grid等介绍
- Ajax实现--javascript