日期:2014-05-16  浏览次数:20372 次

运用js代码实现输出window对象所有属性的方法
运用js代码实现输出window对象所有属性的方法

<html>
<head>
   <title>window object properties array</title>
</head>
<body>
<script>
for (var i in window) {
  document.write ("window property(" + i +  "): " +
     window[i] + "<br>");

}
</script>
</body>
</html>

输出结果

(onbeforeunload): null
window property(onafterprint): null
window property(top): [object]
window property(location):
window property(parent): [object]
window property(offscreenbuffering): auto
window property(frameelement): null
window property(onerror): null
window property(screen): [object]
window property(event): null
window property(clipboarddata): [object]
window property(onresize): null
window property(defaultstatus):
window property(onblur): null
window property(window): [object]
window property(onload): null
window property(onscroll): null
window property(screentop): 127
window property(onfocus): null
window property(option): [object]
window property(length): 0
window property(onbeforeprint): null
window property(frames): [object]
window property(self): [object]
window property(clientinformation):
window property(external): undefined
window property(screenleft): -2
window property(opener): [object]
window property(onunload): null
window property(document): [object]
window property(closed): false
window property(history): [object]
window property(image): [object]
window property(navigator):
window property(status):
window property(onhelp): null
window property(name):

浏览器事件
<form name="aform">
<input type="button" name="big_button" value="big button" onclick="alert('the big button was pressed!')";>
</form>
<script language='css'>
<!--
var aproperty;
for (aproperty in document.aform.big_button) {
      document.write(aproperty,"<br>");
}
//-->
</script>

language
www.3ppt.com
scrollheight
istextedit
currentstyle
document
onmouseup
oncontextmenu
ismultiline
clientheight
onrowexit
onbeforepaste
onactivate
scrollleft
lang
onmousemove
onmove
onselectstart
parenttextedit
oncontrolselect
canhavehtml
onkeypress
oncut
onrowenter
onmousedown
onpaste
classname
id
onreadystatechange
onbeforedeactivate
hidefocus
dir
iscontenteditable
onkeydown
clientwidth
onlosecapture
parentelement
ondrag
ondragstart
oncellchange
recordnumber
onfilterchange
onrowsinserted
ondatasetcomplete
onmousewheel
ondragenter
onblur
onresizeend
onerrorupdate
onbeforecopy
ondblclick
scopename
onkeyup
onresizestart
onmouseover
onmouseleave
outertext
innertext
onmoveend
tagname
title
offsetwidth
onresize
contenteditable
runtimestyle
filters
ondrop
onpage
onrowsdelete
tagurn
offsetleft
clienttop
style
onfocusout
clientleft
ondatasetchanged
canhavechildren
ondeactivate
isdisabled
onpropertychange
ondragover
onhelp
ondragend
onbeforeeditfocus
disabled
onfocus
behaviorurns
accesskey
onscroll
onbeforeactivate
onbeforecut
readystate
all
sourceindex
onclick
scrolltop
oncopy
onfocusin
tabindex
onbeforeupdate
outerhtml
innerhtml
ondataavailable
offsetheight
onmovestar