BOM(brower object):JavaScript实现的一部分,没有统一的标准
BOM功能
- 窗口的打开、关闭、移动、设置大小《》
- 提供浏览器信息的导航条《navigator》
- 提供浏览器中页面信息的定位对象《location》
- 系统屏幕详细洗洗的屏幕对象《screen》
- 对cookie的支持
BOM对象
【window】《》
- 窗口移动【moveBy(x,y)相对;moveTo(x,y)绝对】——x,y为数字,没有单位;左上角为原点,右、下为正方向,可以为负;
- 设置窗口大小【resizeBy(x,y);resizeTo(x,y)】——resizeTo不能为负数。
- 窗口的位置【视口:screenLeft,screenTop——screenX,ScreenY】
- 视口(页面显示区)大小【document.body.offsetWidth,document.body.offsetHeight——innerWidth,】
- 浏览器窗口自身大小【——outerWidth,outerHeight】
- 打开、关闭窗口【open(URL,新窗口标题,窗口修饰属性字符串,),close()——】《 resizable:改变大小; scrollable:滚动条; toolbar:工具栏;status:状态栏; location:是否显示URL》
状态栏【
status="替代href的值";defaultStatus="首次登陆的默认值" 】 - 系统对话框——alert("输出文字")/confirm("提示文字")/prompt("提示文字","默认值");
- 时间间隔(setInterval())和暂停(setTimeout("动作字符串",毫秒数))——时间间隔是循环的,暂停+迭代和时间间隔等效;clearTimeout(函数)用例取消指定的setTimeout()
【screen】《显示器信息》
- availHeight、availWidth:最大高度和宽度
- colorDepth:颜色的位数。
【frames】《?》
【navigator】《》
- appName:浏览器名称
- appVersion:浏览器版本
- appCodeName:浏览器代码,例如:Mozilla
- platform:浏览器平台既操作系统,例如win32
- cookieEnabled:cookie是否可用
- onLine:是否在线
- userAgent:浏览器用户代理报头,例如:Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20100101 Firefox/11.0
*JavaScript 在 IE6、IE5 和 IE4 中的获得的版本号都是4.0。
【history】《》
history.go(数字)《
正则前进history.forward(),负则后退history.back() 》- history.length:历史中的页面数。
【document】《浏览器内容,DOM元素在BOM中的切入口》
【forms】
【anchors】
【location】
- astModified:最后修改时间的字符串
- referrer:历史中后退一步的URL
- title:
- URL:当前载入页面的URL
【location】《浏览器右下角用来表示和解析URL》
- hash:获得锚点的值
- hostname、host:服务器
- pathname:主机后面的部分既主机中的文件路径
- port:端口号
- protocol:协议
- search:获得get方法中的请求参数串
- href=protocol+hostname+port+pathname+hash
HyperTextMarkupLanguage【id class title style dir lang】《标记语言》
注释标记(<!---->)【】
元标记(meta)【http-equiv/name content scheme】《》
文档类型【】
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "
http://www.w3.org/TR/html4/strict.dtd">
基本URL【】《相对路径和基本路径拼接为绝对路径》
<head>
<base href="http://www.w3school.com.cn/i/" />
<base target="_blank" />
</head>
body-框架【】【fremborder longdesc marginheight marginwidth name noresize scrolling src】《frameset开始标记和html之间不能有其它内容:解释型语言》
<frameset cols="25%,50%,25%">
<frame src="/example/html/frame_a.html">
<frame src="/example/html/frame_b.html">
<frame src="/example/html/frame_c.html">
<noframes>
<body>您的浏览器无法处理框架!</body>
</noframes>
</frameset>
css样式引入链接【charset href hreflang target type media】《》
style样式引入链接【】《》
style【type src charset defer】《》
<script type="text/javascript">
document.write("如果显示了这段文字,那么您的浏览器支持 JavaScript!")
</script>
<noscript>No JavaScript support!</noscript>
行级(内嵌)元素【属性:2】《前后元素同一行》
缩写标记【】《为翻译系统和搜索引擎提供游泳的信息》
<abbr title="etcetera">etc.</abbr>
<acronym title="World Wide Web">WWW</acronym>
当您把鼠标移至缩略词语上时,title 可用于展示表达的完整版本。
上下标标签【】《》<p>
This text contains <sub>subscript</sub>
</p>
<p>
This text contains <sup>superscript</sup>
</p>
标签【】《》
输入框【】《type="text(文本)|password(密码)|radio(单选)|checkbox(复选)|button(按钮)|image(图标按钮)value=submit|reset|submit(提交表单)|reset(重置)|file(文件上传enctype=“form/multipart”)|hidden(隐藏字段)" 》
span【】《》
删除-插入【】《》
一打有 <del>二十</del> <ins>十二</ins> 件。
镜子效应【】《左右相反》
<bdo dir="rtl">
Here is some Hebrew text
</bdo>
下拉框【multiple selected】<select>
<optgroup label="Swedish Cars" label="what">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
</optgroup>
<optgroup label="German Cars">
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</optgroup>
</select>
文本框【rows cols】
超链接|锚点【charset href hreflang name rel rev target type】《href属性的值中,“#”后面表示锚点名》
<a href="mailto:service@w3school.com.cn">用户服务信箱</a>
mailto: javascript: news: ftp:
按钮【type value name disabled】
图片-映射-区域【src usemap alt border】【】【shape coords href】
<img src="/i/eg_planets.jpg" border="0" usemap="#planetmap" alt="Planets" />
<map name="planetmap" id="planetmap">
<area shape="circle" coords="180,139,14"
href ="/example/html/venus.html" target ="_blank" alt="Venus" />
<area shape="子图有效形状" coords="子图有效坐标区域"
href ="子图路径" target ="_blank" alt="提示信息(html5无效)" />
<area shape="rect" coords="0,0,110,260"
href ="/example/html/sun.html" target ="_blank" alt="Sun" />
</map>
框架【】
多媒体【】《》
<object classid="clsid:F08DF954-8592-11D1-B16A-00C0F0283628" id="Slider1"
width="100" height="50">
<param name="BorderStyle" value="1" />
<param name="MousePointer" value="0" />
<param name="Enabled" value="1" />
<param name="Min" value="0" />
<param name="Max" value="10" />
</object>
【】《》
缩进【】《》
这是短的引用:
<q>
这是短的引用。
</q>
块级元素【属性:2】《前后元素换行》
缩进【】《》
<blockquote>
这是长的引用。这是长的引用。这是长的引用。这是长的引用。这是长的引用。这是长的引用。这是长的引用。这是长的引用。这是长的引用。这是长的引用。这是长的引用。
</blockquote>
列表【】《o(rdered)l、li有序表;u(nordered)l、li无序表;d(efined)l、d(efined)t(erm)、dd定义表》
表格-标题-表头-行-列 【border cellpadding cellspacing frame rules summary width】【】【】【charoff valign align】《页面布局容器》
<table border="6">
<caption>我的标题</caption>
<col align="left" />
<col align="left" />
<col align="right" />
<colgroup span="2" align="right"></colgroup>
<tr>
<td>100</td>
<td>200</td>
<td>300</td>
</tr>
<tr>
<td>400</td>
<td>500</td>
<td>600</td>
</tr>
</table>
表单元素容器【】《》
<fieldset><legend>表单元素容器的标题</legend>adfdfdff</fieldset>
标题【】
分隔符【hr】
换行【】
段【】
格式元素pre【width】《标签内容以代码样式页面显示》
div【align】《》
表单元素【action accept accept-charset enctype method name target 】12
<form action="form处理后的目的地" method="get(显示)|post(保密)"
name="" id="" accept="服务器可接受类型"
enctype="数据编码(内容)类型form/multipart;"
accept-charset="可用字符集列表" >
*表单验证(非空、有效)和表单数据的提交都可以通过返回false来中断数据提交。