最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

javascript Window及document對(duì)象詳細(xì)整理

 更新時(shí)間:2011年01月12日 00:11:00   作者:  
注:頁(yè)面上元素name屬性以及JavaScript引用的名稱必須一致包括大小寫否則會(huì)提示你1個(gè)錯(cuò)誤信息 引用的元素為空或者不是對(duì)象
一、Window對(duì)象
  -------------------------------------------------- -------------------   
  對(duì)象屬性
  window //窗戶自身
  window.self //引用本窗戶window=window.self
  window.name //為窗戶命名
  window.defaultStatus //設(shè)定窗戶狀態(tài)欄信息
  window.location //URL地址,配備布置這個(gè)屬性可以打開(kāi)新的頁(yè)面
  -------------------------------------------------- -------------------
  對(duì)象方法
  window.alert("text") //提示信息會(huì)話框
  window.confirm("text") //確認(rèn)會(huì)話框
  window.prompt("text") //要求鍵盤輸入會(huì)話框
  window.setIntervel("action",time) //每一隔指定的時(shí)間(毫秒)就執(zhí)行一次操作
  window.clearInterval() //清除時(shí)間配備布置作用就是終止輪回
  window.setTimeout(action,time) //隔了指定的時(shí)間(毫秒)執(zhí)行一次操作
  window.open() //打開(kāi)新的窗戶
  window.close() //關(guān)閉窗戶
  -------------------------------------------------- -------------------
  成員對(duì)象
  window.event
  window.document //見(jiàn)document對(duì)象詳解
  window.history
  window.screen
  window.navigator
  window.external
  -------------------------------------------------- -------------------
  window.history對(duì)象
  window.history.length //瀏覽過(guò)的頁(yè)面數(shù)
  history.back() //撤退退卻
  history.forward() //進(jìn)步
  history.go(i) //前進(jìn)或頭退到歷史記錄的第i個(gè)頁(yè)面
  //i>0進(jìn)步,i<0撤退退卻
  -------------------------------------------------- -------------------
  window.screen對(duì)象
 window.screen.width //屏幕寬度
  window.screen.height //屏幕高度
  window.screen.colorDepth //屏幕色深
  window.screen.availWidth //可用寬度
  window.screen.availHeight //可用高度(除去任務(wù)欄的高度)
  -------------------------------------------------- -------------------
  window.external對(duì)象
  window.external.AddFavorite("地址","標(biāo)題" ) //把網(wǎng)站新增到保藏夾
  -------------------------------------------------- -------------------
  window.navigator對(duì)象
  window.navigator.appCodeName //瀏覽器代碼名
  window.navigator.appName //瀏覽器步伐名
  window.navigator.appMinorVersion //瀏覽器補(bǔ)釘版本
  window.navigator.cpuClass //cpu類型 x86
  window.navigator.platform //操作體系類型 win32
  window.navigator.plugins
  window.navigator.opsProfile
  window.navigator.userProfile
  window.navigator.systemLanguage //客戶體系語(yǔ)言 zh-cn簡(jiǎn)體中文
  window.navigator.userLanguage //用戶語(yǔ)言,同上
  window.navigator.appVersion //瀏覽器版本(包括 體系版本)
  window.navigator.userAgent
  window.navigator.onLine //用戶否在線
  window.navigator.cookieEnabled //瀏覽器是否撐持cookie
  window.navigator.mimeTypes
  ==================================================

二、document對(duì)象

對(duì)象屬性:
document.title //設(shè)置文檔標(biāo)題等價(jià)于HTML的<title>標(biāo)簽
document.bgColor //設(shè)置頁(yè)面背景色
document.fgColor //設(shè)置前景色(文本顏色)
document.linkColor //未點(diǎn)擊過(guò)的鏈接顏色
document.alinkColor //激活鏈接(焦點(diǎn)在此鏈接上)的顏色
document.vlinkColor //已點(diǎn)擊過(guò)的鏈接顏色
document.URL //設(shè)置URL屬性從而在同一窗口打開(kāi)另一網(wǎng)頁(yè)
document.fileCreatedDate //文件建立日期,只讀屬性
document.fileModifiedDate //文件修改日期,只讀屬性
document.fileSize //文件大小,只讀屬性
document.cookie //設(shè)置和讀出cookie
document.charset //設(shè)置字符集 簡(jiǎn)體中文:gb2312
----------------------------

常用對(duì)象方法

document.write() //動(dòng)態(tài)向頁(yè)面寫入內(nèi)容
document.createElement(Tag) //創(chuàng)建一個(gè)html標(biāo)簽對(duì)象
document.getElementById(ID) //獲得指定ID值的對(duì)象
document.getElementsByName(Name) //獲得指定Name值的對(duì)象
document.body.appendChild(oTag)

body-主體子對(duì)象

document.body //指定文檔主體的開(kāi)始和結(jié)束等價(jià)于<body></body>
document.body.bgColor //設(shè)置或獲取對(duì)象后面的背景顏色
document.body.link //未點(diǎn)擊過(guò)的鏈接顏色
document.body.alink //激活鏈接(焦點(diǎn)在此鏈接上)的顏色
document.body.vlink //已點(diǎn)擊過(guò)的鏈接顏色
document.body.text //文本色
document.body.innerText //設(shè)置<body>...</body>之間的文本
document.body.innerHTML //設(shè)置<body>...</body>之間的HTML代碼
document.body.topMargin //頁(yè)面上邊距
document.body.leftMargin //頁(yè)面左邊距
document.body.rightMargin //頁(yè)面右邊距
document.body.bottomMargin //頁(yè)面下邊距
document.body.background //背景圖片
document.body.appendChild(oTag) //動(dòng)態(tài)生成一個(gè)HTML對(duì)象
常用對(duì)象事件

document.body.onclick="func()" //鼠標(biāo)指針單擊對(duì)象是觸發(fā)
document.body.onmouseover="func()" //鼠標(biāo)指針移到對(duì)象時(shí)觸發(fā)
document.body.onmouseout="func()" //鼠標(biāo)指針移出對(duì)象時(shí)觸發(fā)
location-位置子對(duì)象
document.location.hash // #號(hào)后的部分
document.location.host // 域名+端口號(hào)
document.location.hostname // 域名
document.location.href // 完整URL
document.location.pathname // 目錄部分
document.location.port // 端口號(hào)
document.location.protocol // 網(wǎng)絡(luò)協(xié)議(http:)
document.location.search // ?號(hào)后的部分

常用對(duì)象事件
documeny.location.reload() //刷新網(wǎng)頁(yè)
document.location.reload(URL) //打開(kāi)新的網(wǎng)頁(yè)
document.location.assign(URL) //打開(kāi)新的網(wǎng)頁(yè)
document.location.replace(URL) //打開(kāi)新的網(wǎng)頁(yè)
========================================================================
selection-選區(qū)子對(duì)象
document.selection
========================================================================
images集合(頁(yè)面中的圖象):
----------------------------
a)通過(guò)集合引用
document.images //對(duì)應(yīng)頁(yè)面上的<img>標(biāo)簽
document.images.length //對(duì)應(yīng)頁(yè)面上<img>標(biāo)簽的個(gè)數(shù)
document.images[0] //第1個(gè)<img>標(biāo)簽
document.images[i] //第i-1個(gè)<img>標(biāo)簽
----------------------------
b)通過(guò)nane屬性直接引用
<img name="oImage">
document.images.oImage //document.images.name屬性
----------------------------
c)引用圖片的src屬性
document.images.oImage.src //document.images.name屬性.src
----------------------------
d)創(chuàng)建一個(gè)圖象
var oImage
oImage = new Image()
document.images.oImage.src="1.jpg"
同時(shí)在頁(yè)面上建立一個(gè)<img>標(biāo)簽與之對(duì)應(yīng)就可以顯示
----------------------------
示例代碼(動(dòng)態(tài)創(chuàng)建圖象):
<html>
<img name=oImage>
<script language="javascript">
var oImage
oImage = new Image()
document.images.oImage.src="1.jpg"
</script>
</html>

<html>
<script language="javascript">
oImage=document.caeateElement("IMG")
oImage.src="1.jpg"
</script>

相關(guān)文章

最新評(píng)論

桂东县| 茌平县| 吉林省| 德阳市| 石狮市| 潮州市| 新宁县| 琼结县| 鲁甸县| 中宁县| 革吉县| 巴楚县| 明溪县| 石嘴山市| 堆龙德庆县| 抚州市| 龙岩市| 乌拉特前旗| 巴塘县| 三门峡市| 武陟县| 榆社县| 广州市| 宁晋县| 商城县| 突泉县| 老河口市| 博湖县| 卓尼县| 河曲县| 驻马店市| 西丰县| 台山市| 濮阳县| 南平市| 南乐县| 会昌县| 红原县| 昌吉市| 仁化县| 新沂市|