启红 发表于 2012-12-22 21:30:07

BOM 浏览器对象模型

<div id="cnblogs_post_body">                                       BOM 浏览器对象模型
winddow.document,为什么之前的学习中,直接写document?
答:因为window对象是最大的一个对象,所有对象都在其内部
写document 默认就是在最全局的window下面属性或了对象。
Document对象其实是window的一人属性(或子对象)
DOM--->docudent
BOM--->window

Window对象的子对象
navigator对象属性

(一) window.navigator
document.write(window.navigator.appMinorVersion+'---1. 返回浏览器的次级版本'+'<br />');
document.write(window.navigator.appCodeName+'---    2.返回浏览器的代码名'+'<br />');
document.write(window.navigator.appVersion+'---   3.返回浏览器的平台和版本信息'+'<br />');   
document.write(window.navigator.browserLanguage+'---5.返回当前浏览器的语言'+'<br />');
document.write(window.navigator.cookieEnabled+'---6.返回指明浏览器中是否启用 cookie 的布尔值'+'<br />');
document.write(window.navigator.cpuClass+'---       7.返回浏览器系统的 CPU 等级'+'<br />');      
document.write(window.navigator.onLine +'---      8.返回指明系统是否处于脱机模式的布尔值'+'<br />');         
document.write(window.navigator.platform+'---       9.返回运行浏览器的操作系统平台'+'<br />');      
document.write(window.navigator.systemLanguage+'---10.返回 OS 使用的默认语言'+'<br />');
document.write(window.navigator.userAgent +'---    11.返回由客户机发送服务器的 user-agent 头部的值'+'<br />'); document.write(window.navigator.userLanguage+'---12.返回 OS 的自然语言设置 ' +'<br />');

window.navigator的代码展示:

<div class="cnblogs_code"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN"><head><title>navigator</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="description" content="" /><meta name="keywords" content="" /><script type="text/javascript">document.write(window.navigator.appMinorVersion+'---1. 返回浏览器的次级版本'+'<br />');document.write(window.navigator.appCodeName+'--- 2.返回浏览器的代码名'+'<br />'); document.write(window.navigator.appVersion+'--- 3.返回浏览器的平台和版本信息'+'<br />'); document.write(window.navigator.browserLanguage+'---5.返回当前浏览器的语言'+'<br />'); document.write(window.navigator.cookieEnabled+'--- 6.返回指明浏览器中是否启用 cookie 的布尔值'+'<br />'); document.write(window.navigator.cpuClass+'--- 7.返回浏览器系统的 CPU 等级'+'<br />'); document.write(window.navigator.onLine +'--- 8.返回指明系统是否处于脱机模式的布尔值'+'<br />'); document.write(window.navigator.platform+'--- 9.返回运行浏览器的操作系统平台'+'<br />'); document.write(window.navigator.systemLanguage+'---10.返回 OS 使用的默认语言'+'<br />');document.write(window.navigator.userAgent +'--- 11.返回由客户机发送服务器的 user-agent 头部的值'+'<br />'); document.write(window.navigator.userLanguage+'--- 12.返回 OS 的自然语言设置 ' +'<br />');</script><style type="text/css"></style></head>    <body>    </body></html>
页: [1]
查看完整版本: BOM 浏览器对象模型