本站首页    管理页面    写新日志    退出

The Neurotic Fishbowl

[web developer center]html element or object supported in different broswers --- all[]
snowrose 发表于 2007/9/16 14:42:22

(3)all[]   i don't like this attribute actually,because this is not the valid sytax in javascript,i have a eletric book named dhtml,but i think it is very old,if you are a programmer and your code just support one or two browser ,that is ok,but if your codes requires very strict,you shouldn't use this,and this is a topic wroten by a american,the link is :http://javascript.about.com/od/hintsandtips/a/worst_4.htm,what he said is reasonable,so i just copy the conent of the dhtml book to descript it,sometimes we should use invalid js to hack the bugs: Returns a reference to the collection of elements contained by the object. Syntax [ collAll = ] object.all [ oObject = ] object.all(vIndex [, iSubIndex]) Possible Values collAll Array of elements contained by the object. oObject Reference to an individual item in the array of elements contained by the object. vIndex Required. Integer or string that specifies the element or collection to retrieve. If this parameter is an integer, the method returns the element in the collection at the given position, where the first element has value 0, the second has 1, and so on. If this parameter is a string and there is more than one element with the name or id property equal to the string, the method returns a collection of matching elements. iSubIndex Optional. Position of an element to retrieve. This parameter is used when vIndex is a string. The method uses the string to construct a collection of all elements that have a name or id property equal to the string, and then retrieves from this collection the element at the position specified by iSubIndex. Members Table The following table lists the members exposed by the all object. Click a tab on the left to choose the type of member you want to view. .oMembersTable {} TD {} .oMTab {background:#eeeeee; width:100%; height:20px; border-top=1px solid #6699cc; padding:7px; padding-left:7px; cursor:hand;} .oMTabOn {background:#999999; width:100%; height:20px; color:#ffffff; border-top:1px groove white; padding:7px; padding-left:7px; cursor:hand;} .oMTabHover {background:#dddddd; width:100%; height:20px; border-top=1px solid #6699cc; padding:7px; padding-left:7px; cursor:hand;}   Attributes/Properties 500)this.width=500'>   SHOW: Attributes/Properties Methods Property Description length Sets or retrieves the number of objects in a collection. Attributes/Properties Methods Method Description item Retrieves an object from the all collection or various other collections. namedItem 500)this.width=500'>  Retrieves an object or a collection from the specified collection. tags Retrieves a collection of objects that have the specified HTML tag name. urns Retrieves a collection of all objects to which a specified behavior is attached. Remarks The all collection includes one element object for each valid HTML tag. If a valid tag has a matching end tag, both tags are represented by the same element object. The collection returned by the document's all collection always includes a reference to the HTML, HEAD, and TITLE objects regardless of whether the tags are present in the document. If the BODY tag is not present, but other HTML tags are, a BODY object is added to the all collection. If the document contains invalid or unknown tags, the collection includes one element object for each. Unlike valid end tags, unknown end tags are represented by their own element objects. The order of the element objects is the HTML source order. Although the collection indicates the order of tags, it does not indicate hierarchy. The name property only applies to some elements such as form elements. If the vIndex is set to a string matching the value of a name property in an element that the name property does not apply, then that element will not be added to the collection. Examples This example, in Microsoft® JScript® (compatible with ECMA 262 language specification), shows how to display the names of all tags in the document in the order the tags appear in the document. for(i = 0; i < document.all.length; i++){ alert(document.all(i).tagName); } This example, also in JScript, shows how to use the item method on the all collection to retrieve all element objects for which the name property or ID attribute is set to sample. Depending on the number of times the name or ID is defined in the document, the item method returns null, a single element object, or a collection of element objects. The value of the length property of the collection determines whether item returns a collection or a single object. SHOWExamplevar oObject = document.all.item("sample"); if (oObject != null){ if (oObject.length != null){ for (i = 0; i < oObject.length; i++){ alert(oObject(i).tagName); } } else{ alert(oObject.tagName); } } Standards Information There is no public standard that applies to this collection.  

阅读全文(3558) | 回复(1) | 编辑 | 精华

 


回复:html element or object supported in different broswers --- all[]
S(游客)发表评论于2009/4/8 13:42:33

 擦窗机 空调安装 北京空调安装 北京空调移机 梅兰ups 吸塑 吸塑包装 吸塑制品 热喷涂 锅炉防磨 锅炉喷涂施工 钢板网 护栏网 气液过滤网 铁丝网 尼龙网 模拟高尔夫 室内模拟高尔夫 模拟射击 光枪游戏 激光狩猎 激光射击 咖啡机 眩晕 美尼尔氏综合症 礼品盒 包装盒

个人主页 | 引用回复 | 主人回复 | 返回 | 编辑 | 删除

 


» 1 »

发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)

 
 



The Neurotic Fishbowl

.: 公告




Bloginess

«September 2025»
123456
78910111213
14151617181920
21222324252627
282930

.: 我的分类(专题)

首页(130)
RIA(22)
linux(3)
J2EE(24)
the mood of everyday(58)
oral English(14)
database(2)
soap(3)
java(9)
web developer center(14)


In the Bowl

.: 最新日志

倾情奉献iphone、ipod、ipho
check ipad's rotatio
css position fixed d
field validation whe
常见浏览器cookie个数和大小限制说明
人类无法抗拒的10种心理,学会它,就能控
读as3cookbook 有感
flex builder linux s
Component returned f
use tramp in emacs i


.: 最新回复

replcica watches
replcica watches
Dell spikes game sit
回复:人类无法抗拒的10种心理,学会它,
回复:人类无法抗拒的10种心理,学会它,
回复:flex builder linu
回复:人类无法抗拒的10种心理,学会它,
回复:人类无法抗拒的10种心理,学会它,
回复:致女人------摘自读者
回复:虚心接受别人的意见,谨慎改正


The Fishkeeper
blog名称:up forever
日志总数:130
评论数量:274
留言数量:4
访问次数:1949163
建立时间:2006年5月25日



Text Me

.: 留言板

签写新留言

参观
这个界面很漂亮!
我试试吧
up forever
该换了!


Other Fish in the Sea

.: 链接


http://blogger.org.cn/blog/more.asp?name=hongrui&id=16955

邢红瑞 

http://niegc.cublog.cn/  聂国聪

http://www.blogjava.net/SteelHand/ 铁手剑谱

http://blog.sina.com.cn/qianqq 糖qq

http://blog.csdn.net/misty_wish   师弟

http://www.bbxy.net/xiaoyu/ Goteet老师

http://www.chinaitpower.com    中国it动力

http://jinyuxi.blog.sohu.com/ 靳羽西




lvetica, sans-serif; MARGIN: 0px 0px 8px; PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; PADDING-TOP: 0px } DIV.blogrollmain { FONT: 12px verdana, arial, helvetica, sans-serif } BLOCKQUOTE { COLOR: #202020; FONT: 11px verdana, arial, helvetica, sans-serif } .tinyfont { FONT: 9px verdana, arial, helvetica, sans-serif } TD { COLOR: #202020; FONT-FAMILY: verdana; FONT-SIZE: 12px } .title { COLOR: #996897; FONT-FAMILY: verdana, sans-serif; FONT-SIZE: 10pt; FONT-WEIGHT: bold } .titlefont { COLOR: #996897; FONT-FAMILY: verdana, sans-serif; FONT-SIZE: 14px; FONT-STYLE: italic } .titlefontarch { BORDER-BOTTOM: 1px solid; BORDER-LEFT: 1px solid; BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; COLOR: #996897; FONT-FAMILY: verdana, sans-serif; FONT-SIZE: 14px; TEXT-ALIGN: center; WIDTH: 100% } .menu_text { COLOR: #c1ae94; FONT-FAMILY: Verdana, Arial, sans-serif; FONT-SIZE: 10px; MARGIN-BOTTOM: 1px } .links { FONT-FAMILY: Verdana, Arial, sans-serif; FONT-SIZE: 11px } .smallfont { COLOR: #202020; FONT-FAMILY: Verdana, Arial, sans-serif; FONT-SIZE: 11px; MARGIN: 0px } A:link { COLOR: #996897; TEXT-DECORATION: none } A:visited { COLOR: #996897; TEXT-DECORATION: none } A:hover { BACKGROUND-COLOR: #996897; COLOR: #610862; TEXT-DECORATION: underline } A { TEXT-DECORATION: none } .content { WIDTH: auto } .dateheader { MARGIN: 0px; PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; PADDING-TOP: 0px; POSITION: relative; WIDTH: auto; Z-INDEX: 3; min-width: 120px } .wbtn1 { BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #996897 1px solid; BORDER-LEFT: #996897 1px solid; BORDER-RIGHT: #996897 1px solid; BORDER-TOP: #996897 1px solid; COLOR: #996897; FONT-FAMILY: verdana, arial geneva; FONT-SIZE: 7pt; TEXT-DECORATION: none } .calendar { PADDING-BOTTOM: 4px; PADDING-LEFT: 4px; PADDING-RIGHT: 4px; PADDING-TOP: 4px; TEXT-ALIGN: center } .calhead { BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: gray 1px solid; COLOR: black; TEXT-ALIGN: center; VERTICAL-ALIGN: middle; WIDTH: 14% } .calbody { BORDER-BOTTOM: 1px solid; TEXT-ALIGN: center; VERTICAL-ALIGN: middle; WIDTH: 14% } .style2 {color: #996897}
本站首页    管理页面    写新日志    退出

The Neurotic Fishbowl

[web developer center]html element or object supported in different broswers --- all[]
snowrose 发表于 2007/9/16 14:42:22

(3)all[]   i don't like this attribute actually,because this is not the valid sytax in javascript,i have a eletric book named dhtml,but i think it is very old,if you are a programmer and your code just support one or two browser ,that is ok,but if your codes requires very strict,you shouldn't use this,and this is a topic wroten by a american,the link is :http://javascript.about.com/od/hintsandtips/a/worst_4.htm,what he said is reasonable,so i just copy the conent of the dhtml book to descript it,sometimes we should use invalid js to hack the bugs: Returns a reference to the collection of elements contained by the object. Syntax [ collAll = ] object.all [ oObject = ] object.all(vIndex [, iSubIndex]) Possible Values collAll Array of elements contained by the object. oObject Reference to an individual item in the array of elements contained by the object. vIndex Required. Integer or string that specifies the element or collection to retrieve. If this parameter is an integer, the method returns the element in the collection at the given position, where the first element has value 0, the second has 1, and so on. If this parameter is a string and there is more than one element with the name or id property equal to the string, the method returns a collection of matching elements. iSubIndex Optional. Position of an element to retrieve. This parameter is used when vIndex is a string. The method uses the string to construct a collection of all elements that have a name or id property equal to the string, and then retrieves from this collection the element at the position specified by iSubIndex. Members Table The following table lists the members exposed by the all object. Click a tab on the left to choose the type of member you want to view. .oMembersTable {} TD {} .oMTab {background:#eeeeee; width:100%; height:20px; border-top=1px solid #6699cc; padding:7px; padding-left:7px; cursor:hand;} .oMTabOn {background:#999999; width:100%; height:20px; color:#ffffff; border-top:1px groove white; padding:7px; padding-left:7px; cursor:hand;} .oMTabHover {background:#dddddd; width:100%; height:20px; border-top=1px solid #6699cc; padding:7px; padding-left:7px; cursor:hand;}   Attributes/Properties 500)this.width=500'>   SHOW: Attributes/Properties Methods Property Description length Sets or retrieves the number of objects in a collection. Attributes/Properties Methods Method Description item Retrieves an object from the all collection or various other collections. namedItem 500)this.width=500'>  Retrieves an object or a collection from the specified collection. tags Retrieves a collection of objects that have the specified HTML tag name. urns Retrieves a collection of all objects to which a specified behavior is attached. Remarks The all collection includes one element object for each valid HTML tag. If a valid tag has a matching end tag, both tags are represented by the same element object. The collection returned by the document's all collection always includes a reference to the HTML, HEAD, and TITLE objects regardless of whether the tags are present in the document. If the BODY tag is not present, but other HTML tags are, a BODY object is added to the all collection. If the document contains invalid or unknown tags, the collection includes one element object for each. Unlike valid end tags, unknown end tags are represented by their own element objects. The order of the element objects is the HTML source order. Although the collection indicates the order of tags, it does not indicate hierarchy. The name property only applies to some elements such as form elements. If the vIndex is set to a string matching the value of a name property in an element that the name property does not apply, then that element will not be added to the collection. Examples This example, in Microsoft® JScript® (compatible with ECMA 262 language specification), shows how to display the names of all tags in the document in the order the tags appear in the document. for(i = 0; i < document.all.length; i++){ alert(document.all(i).tagName); } This example, also in JScript, shows how to use the item method on the all collection to retrieve all element objects for which the name property or ID attribute is set to sample. Depending on the number of times the name or ID is defined in the document, the item method returns null, a single element object, or a collection of element objects. The value of the length property of the collection determines whether item returns a collection or a single object. SHOWExamplevar oObject = document.all.item("sample"); if (oObject != null){ if (oObject.length != null){ for (i = 0; i < oObject.length; i++){ alert(oObject(i).tagName); } } else{ alert(oObject.tagName); } } Standards Information There is no public standard that applies to this collection.  

阅读全文(3558) | 回复(1) | 编辑 | 精华

 


回复:html element or object supported in different broswers --- all[]
S(游客)发表评论于2009/4/8 13:42:33

 擦窗机 空调安装 北京空调安装 北京空调移机 梅兰ups 吸塑 吸塑包装 吸塑制品 热喷涂 锅炉防磨 锅炉喷涂施工 钢板网 护栏网 气液过滤网 铁丝网 尼龙网 模拟高尔夫 室内模拟高尔夫 模拟射击 光枪游戏 激光狩猎 激光射击 咖啡机 眩晕 美尼尔氏综合症 礼品盒 包装盒

个人主页 | 引用回复 | 主人回复 | 返回 | 编辑 | 删除

 


» 1 »

发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)

 
 



The Neurotic Fishbowl

.: 公告




Bloginess

«September 2025»
123456
78910111213
14151617181920
21222324252627
282930

.: 我的分类(专题)

首页(130)
RIA(22)
linux(3)
J2EE(24)
the mood of everyday(58)
oral English(14)
database(2)
soap(3)
java(9)
web developer center(14)


In the Bowl

.: 最新日志

倾情奉献iphone、ipod、ipho
check ipad's rotatio
css position fixed d
field validation whe
常见浏览器cookie个数和大小限制说明
人类无法抗拒的10种心理,学会它,就能控
读as3cookbook 有感
flex builder linux s
Component returned f
use tramp in emacs i


.: 最新回复

replcica watches
replcica watches
Dell spikes game sit
回复:人类无法抗拒的10种心理,学会它,
回复:人类无法抗拒的10种心理,学会它,
回复:flex builder linu
回复:人类无法抗拒的10种心理,学会它,
回复:人类无法抗拒的10种心理,学会它,
回复:致女人------摘自读者
回复:虚心接受别人的意见,谨慎改正


The Fishkeeper
blog名称:up forever
日志总数:130
评论数量:274
留言数量:4
访问次数:1949163
建立时间:2006年5月25日



Text Me

.: 留言板

签写新留言

参观
这个界面很漂亮!
我试试吧
up forever
该换了!


Other Fish in the Sea

.: 链接


http://blogger.org.cn/blog/more.asp?name=hongrui&id=16955

邢红瑞 

http://niegc.cublog.cn/  聂国聪

http://www.blogjava.net/SteelHand/ 铁手剑谱

http://blog.sina.com.cn/qianqq 糖qq

http://blog.csdn.net/misty_wish   师弟

http://www.bbxy.net/xiaoyu/ Goteet老师

http://www.chinaitpower.com    中国it动力

http://jinyuxi.blog.sohu.com/ 靳羽西




站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.047 second(s), page refreshed 144762380 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号