-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBOM编程.html
20 lines (19 loc) · 17.2 KB
/
BOM编程.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<html>
<head>
<title>BOM编程</title>
<basefont face="微软雅黑" size="2" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="exporter-version" content="Evernote Windows/304720 (zh-CN, DDL); Windows/10.0.14393 (Win64);"/>
<style>
body, td {
font-family: 微软雅黑;
font-size: 10pt;
}
</style>
</head>
<body>
<a name="2714"/>
<h1>BOM编程</h1>
<div>
<span><div><ol style="margin-bottom: 0mm; margin-left: 0mm; padding-left: 0pt;"><li style="margin-left: 15pt; margin-right: 0pt; padding-left: 3pt; text-indent:0pt; font-family: Courier New; font-size: 22pt; font-weight: Bold; color: #010101;"><div style="margin-top: 0pt; margin-bottom: 17pt;"><h1 align="justify"><font color="#010101" face="Courier New" size="5"><span style="font-size:22pt; font-family:Courier New; color:#010101; font-weight:Bold; font-style:Normal; font-decoration:Normal"><b>BOM</b></span></font><font color="#010101" face="宋体" size="5"><span style="font-size:22pt"><b>编程</b></span></font></h1><ol style="margin-bottom: 0mm; margin-left: 0mm; padding-left: 0pt;"><li style="margin-left: -6pt; margin-right: 0pt; padding-left: 10pt; text-indent:0pt; font-family: Courier New; font-size: 16pt; font-weight: Bold; color: #010101;"><div style="margin-top: 0pt; margin-bottom: 13pt;"><h2 align="justify"><font color="#010101" face="Courier New" size="4"><span style="font-size:16pt; font-family:Courier New; color:#010101; font-weight:Bold; font-style:Normal; font-decoration:Normal"><b>BOM</b></span></font><font color="#010101" face="黑体" size="4"><span style="font-size:16pt"><b>编程基础</b></span></font></h2></div></li></ol></div></li></ol><div align="justify" style="min-height: 13pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> </span></font><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">全称 Browser Object Model,浏览器对象模型。</span></font></div><div align="justify" style="min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> JavaScript</span></font><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">是由浏览器中内置的javascript脚本解释器程序来执行javascript脚本语言的。</span></font></div><div align="justify" style="min-height: 13pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> </span></font><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">为了便于对浏览器的操作,javascript封装了对浏览器的各个对象使得开发者可以方便的操作浏览器。</span></font></div><ol start="2" style="margin-top: 0mm; margin-bottom: 0mm; margin-left: 0mm; padding-left: 0pt;"><li style="list-style-type: none;"><ol start="2" style="margin-bottom: 0mm; margin-left: 0mm; padding-left: 0pt;"><li style="margin-left: 12pt; margin-right: 0pt; padding-left: 10pt; text-indent:0pt; font-family: Courier New; font-size: 16pt; font-weight: Bold; color: #010101;"><div style="margin-top: 0pt; margin-bottom: 13pt;"><h2 align="justify"><font color="#010101" face="Courier New" size="4"><span style="font-size:16pt; font-family:Courier New; color:#010101; font-weight:Bold; font-style:Normal; font-decoration:Normal"><b>BOM</b></span></font><font color="#010101" face="黑体" size="4"><span style="font-size:16pt"><b>对象:</b></span></font></h2></div></li><li style="margin-left: 12pt; margin-right: 0pt; padding-left: 10pt; text-indent:0pt; font-family: Courier New; font-size: 16pt; font-weight: Bold; color: #010101;"><div style="margin-top: 0pt; margin-bottom: 13pt;"><h2 align="justify"><font color="#010101" face="Courier New" size="4"><span style="font-size:16pt; font-family:Courier New; color:#010101; font-weight:Bold; font-style:Normal; font-decoration:Normal"><b>window</b></span></font> <font color="#010101" face="黑体" size="4"><span style="font-size:16pt"><b>对象</b></span></font></h2></div></li></ol></li></ol><div align="justify" style="min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> Window</span></font> <font color="#010101" face="宋体" size="2"><span style="font-size:10pt">对象是 JavaScript 层级中的顶层对象。</span></font></div><div align="justify" style="min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> Window</span></font> <font color="#010101" face="宋体" size="2"><span style="font-size:10pt">对象代表一个浏览器窗口或一个框架。</span></font></div><div align="justify" style="min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> Window</span></font> <font color="#010101" face="宋体" size="2"><span style="font-size:10pt">对象会在 <body> 或 <frameset> 每次出现时被自动创建。</span></font></div><ol style="margin-top: 0mm; margin-bottom: 0mm; margin-left: 0mm; padding-left: 0pt;"><li style="list-style-type: none;"><ol style="margin-top: 0mm; margin-bottom: 0mm; margin-left: 0mm; padding-left: 0pt;"><li style="list-style-type: none;"><ol style="margin-bottom: 0mm; margin-left: 0mm; padding-left: 0pt;"><li style="margin-left: 9pt; margin-right: 0pt; padding-left: 17pt; text-indent:0pt; font-family: ����; font-size: 16pt; font-weight: Bold; color: #010101;"><div style="margin-top: 0pt; margin-bottom: 13pt;"><h3 align="justify"><font color="#010101" face="Times New Roman" size="4"><span style="font-size:16pt; font-family:Times New Roman; color:#010101; font-weight:Bold; font-style:Normal; font-decoration:Normal"><b>window</b></span></font><font color="#010101" face="宋体" size="4"><span style="font-size:16pt"><b>中的方法</b></span></font></h3></div></li></ol></li></ol></li></ol><div align="justify" style="min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> document </span></font><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">对 Document 对象的只读引用</span></font></div><div align="justify" style="min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> location </span></font><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">用于窗口或框架的 Location 对象</span></font></div><div align="justify" style="min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> history </span></font><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">对 History 对象的只读引用。 </span></font></div><div align="justify" style="margin-left:0mm; margin-right:0mm; text-indent:7mm; margin-top:0.00mm; margin-bottom:0.00mm;min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt">document.tilte </span></font><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">设置网页的标题</span></font></div><div align="left" style="min-height: 15pt;"><font color="#010101" face="宋体"><span style="font-size:12pt"> </span></font><a href="mk:@MSITStore:E:%5C%CE%C4%B5%B5%5CDHTML.chm::/DHTMLref/methods/moveTo.html"><font color="#010101" face="����"><span style="font-size:12pt">moveto</span></font></a><font color="#010101" face="宋体"><span style="font-size:12pt">() 将窗口左上角的屏幕位置移动到指定的</span> <span style="font-size:12pt"><i>x</i></span> <span style="font-size:12pt">和</span> <span style="font-size:12pt"><i>y</i></span> <span style="font-size:12pt">位置。</span></font></div><div align="justify" style="min-height: 13pt;"><font color="#010101" face="宋体" size="2"><span style="font-size:10pt"> moveby() 相对于目前的位置移动。</span></font></div><div align="left" style="margin-left:0mm; margin-right:0mm; text-indent:8mm; margin-top:0.00mm; margin-bottom:0.00mm;min-height: 15pt;"><font color="#010101" face="����"><span style="font-size:12pt">resizeTo() 调整当前浏览器的窗口。</span></font></div><div align="justify" style="min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> open() </span></font><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">打开新窗口显示指定的URL(有的浏览器中是打一个新的选项卡)</span></font></div><div align="justify" style="min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> setTimeout(vCode, iMilliSeconds) </span></font><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">超时后执行代码。</span></font></div><div align="justify" style="margin-left:9mm; margin-right:0mm; text-indent:-2mm; margin-top:0.00mm; margin-bottom:0.00mm;min-height: 14pt;"><div><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt">setInterval(vCode, iMilliSeconds) </span></font><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">定时执行代码,第一次也是先待,到时再执行。</span></font></div><div><h3 align="justify"><font color="#010101" face="Courier New" size="4"><span style="font-size:16pt"><b>location</b></span></font> <font color="#010101" face="宋体" size="4"><span style="font-size:16pt"><b>对象</b></span></font></h3><div align="justify" style="min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt">Location</span></font> <font color="#010101" face="宋体" size="2"><span style="font-size:10pt">对象是由 JavaScript runtime engine 自动创建的,包含有关当前 URL 的信息。</span></font></div><div align="justify" style="min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt">location</span></font><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">中的重要方法:</span></font></div><div align="justify" style="min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> href</span></font><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">属性</span></font><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> </span></font><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">设置或获取整个 URL 为字符串。</span></font></div><div align="justify" style="min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> reload() </span></font><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">重新装入当前页面</span></font></div><ol style="margin-top: 0mm; margin-bottom: 0mm; margin-left: 0mm; padding-left: 0pt;"><li style="list-style-type: none;"><ol style="margin-top: 0mm; margin-bottom: 0mm; margin-left: 0mm; padding-left: 0pt;"><li style="list-style-type: none;"><ol style="margin-bottom: 0mm; margin-left: 0mm; padding-left: 0pt;"><li style="margin-left: 9pt; margin-right: 0pt; padding-left: 17pt; text-indent:0pt; font-family: Courier New; font-size: 16pt; font-weight: Bold; color: #010101;"><div style="margin-top: 0pt; margin-bottom: 13pt;"><h3 align="justify"><font color="#010101" face="Courier New" size="4"><span style="font-size:16pt; font-family:Courier New; color:#010101; font-weight:Bold; font-style:Normal; font-decoration:Normal"><b>screen</b></span></font> <font color="#010101" face="宋体" size="4"><span style="font-size:16pt"><b>对象</b></span></font></h3></div></li></ol></li></ol></li></ol><div align="justify" style="min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> Screen</span></font> <font color="#010101" face="宋体" size="2"><span style="font-size:10pt">对象是由 JavaScript runtime engine 自动创建的,包含有关客户机显示屏幕的信息。</span></font></div><div align="justify" style="min-height: 13pt;"><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">属性:</span></font></div><div align="justify" style="min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> availHeight </span></font><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">获取系统屏幕的工作区域高度,排除 Microsoft Windows 任务栏。</span></font> <font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> </span></font></div><div align="justify" style="min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> availWidth </span></font><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">获取系统屏幕的工作区域宽度,排除 Windows 任务栏。</span></font> <font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> </span></font></div><div align="justify" style="min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> height </span></font><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">获取屏幕的垂直分辨率。</span></font></div><div align="justify" style="min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> width </span></font><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">获取屏幕的水平分辨率。</span></font></div><div align="justify" style="min-height: 10pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> </span></font></div><div align="justify" style="min-height: 13pt;"><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">示例:</span></font></div><div align="justify" style="min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> document.write("</span></font><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">屏幕工作区: " + screen.availHeight + ", " + screen.availWidth + "<br>");</span></font></div><div align="justify" style="min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> document.write("</span></font><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">屏幕分辨率: " + screen.height + ", " + screen.width + "<br>");</span></font></div><ol start="2" style="margin-top: 0mm; margin-bottom: 0mm; margin-left: 0mm; padding-left: 0pt;"><li style="list-style-type: none;"><ol start="2" style="margin-top: 0mm; margin-bottom: 0mm; margin-left: 0mm; padding-left: 0pt;"><li style="list-style-type: none;"><ol start="2" style="margin-bottom: 0mm; margin-left: 0mm; padding-left: 0pt;"><li style="margin-left: 9pt; margin-right: 0pt; padding-left: 17pt; text-indent:0pt; font-family: Courier New; font-size: 16pt; font-weight: Bold; color: #010101;"><div style="margin-top: 0pt; margin-bottom: 13pt;"><h3 align="justify"><font color="#010101" face="Courier New" size="4"><span style="font-size:16pt; font-family:Courier New; color:#010101; font-weight:Bold; font-style:Normal; font-decoration:Normal"><b>document</b></span></font><font color="#010101" face="宋体" size="4"><span style="font-size:16pt"><b>对象</b></span></font></h3></div></li></ol></li></ol></li></ol><div align="justify" style="min-height: 13pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> </span></font><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">该对象代表整个文档页面</span></font></div><div align="justify" style="min-height: 13pt;"><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">对象的集合:</span></font></div><div align="justify" style="min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> all </span></font> <font color="#010101" face="宋体" size="2"><span style="font-size:10pt">获取页面所有元素对象</span></font></div><div align="justify" style="min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> forms </span></font> <font color="#010101" face="宋体" size="2"><span style="font-size:10pt">获取页面所有表单对象</span></font></div><div align="justify" style="min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> images </span></font><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">获取页面所有图片对象</span></font></div><div align="justify" style="min-height: 14pt;"><font color="#010101" face="Courier New" size="2"><span style="font-size:10pt"> links </span></font> <font color="#010101" face="宋体" size="2"><span style="font-size:10pt">获取所有超链接或area对象</span></font></div><div align="justify" style="min-height: 13pt;"><div><font color="#010101" face="宋体" size="2"><span style="font-size:10pt">具体的内容会在学习DOM时学习。</span></font></div></div></div></div></div></span>
</div></body></html>