- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
ie和firefox在javascript方面的兼容性(Compatibility of IE and Firefox in JavaScript)
ie和firefox在javascript方面的兼容性(Compatibility of IE and Firefox in JavaScript)
1.document.formname.item (itemname) 问题
说明:
ie下, 可以使用 document.formname.item (itemname) 或 document.formname.elements [elementname];
firefox下, 只能使用 document.formname.elements [elementname].
解决方法:
统一使用 document.formname.elements [elementname].
text1.
document.formname.item (itemname)
document.formname.elements [elementname]
2.集合类对象问题
说明:
ie下, 可以使用 () 或 [] 获取集合类对象;
firefox下, 只能使用 [] 获取集合类对象.
解决方法:
统一使用 [] 获取集合类对象.
text2.
document. forms (formname)
document. forms [formname]
text3:
document.getelementsbyname (inputname) (0)
document.getelementsbyname (inputname) [0]
3.自定义属性问题
说明:
ie下, 可以使用获取常规属性的方法来获取自定义属性, 也可以使用getattribute () 获取自定义属性;
firefox下, 只能使用getattribute () 获取自定义属性.
解决方法:
统一通过getattribute () 获取自定义属性.
text4:
直接获取自定义属性的值
通过getattribute () 获取自定义属性的值
4.eval (idname) 问题
说明:
ie下, 可以使用eval (idname) 或getelementbyid (idname) 来取得id为idname的html对象;
firefox下只能使用getelementbyid (idname) 来取得id为idname的html对象.
解决方法:
统一用getelementbyid (idname) 来取得id为idname的html对象.
text5:
eval (idname)
document.getelementbyid (itemid)
5.变量名与某html对象id相同的问题
说明:
ie下, html对象的id可以作为document的下属对象变量名直接使用;
firefox下则不能.
firefox下, 可以使用与html对象id相同的变量名;
ie下则不能.
解决方法:
使用 document.getelementbyid (idname) 代替document.idname.最好不要取html对象id相同的变量名, 以减少错误; 在声明变量时, 一律加上var, 以避免歧义.
6.const问题
说明:
firefox下, 可以使用const关键字或var关键字来定义常量;
Under IE, you can only define constants using the VaR keyword
Resolvent:
The unified use of the VaR keyword defines constants
,
7.input.type attribute problem
Explain:
Under IE, the input.type property is read-only, but under Firefox the input.type property is read and write
,
8.window.event problem
Explain:
Window.event can only run under IE and not run under Firefox, because Firefoxs event can only be used at the site of the event
Resolvent:
IE:
input name= Button8_1 type= button value= IE /
...
script language= JavaScript
Function, gotoSubmit8_1 () {
...
Alert (window.event); //use window.event
...
}
/script
IEFiref
您可能关注的文档
- 2011年磷矿石出口配额申报条件及程序的公告(Announcement on the conditions and procedures for the declaration of phosphorus ore export quotas in 2011).doc
- 2011年江西省南昌市中考语文试题及答案(Chinese examination questions and answers in Jiangxi, Nanchang in 2011).doc
- 2011年胡润财富排行榜(Hurun wealth list in 2011).doc
- 2011年陕西高考数学试题及答案(理科)(Mathematics examination questions and answers of Shaanxi college entrance examination in 2011 (Science)).doc
- 2011年青浦区高三化学一模试卷(附答案)(Qingpu District in 2011 the first mock exam papers of Senior Chemistry (with answers)).doc
- 2011微博营销发展方向漫谈(2011, micro-blog marketing development direction).doc
- 2011湖南衡阳物理试题(2011 Hunan Hengyang physics examination).doc
- 2011总结(2011 summary).doc
- 2011申论热点剖析人肉搜索案暴露民事立法之不足(Analysis on 2011 hot spots human flesh search case exposed a lack of civil legislation).doc
- 2011福建高考满分作文(2011 Fujian college entrance examination scores).doc
- ie与firefox的css兼容问题(CSS compatibility issues with IE and Firefox).doc
- ie和firefox的js兼容性整理(JS compatibility with IE and Firefox).doc
- ie和火狐的css兼容(Ie is compatible with Firefox's CSS).doc
- ie和ff兼容问题(IE and FF compatibility issues).doc
- ie和firefox兼容(Ie compatible with Firefox).doc
- iis apache+php+mysql+zend optimizer+phpmyadmin安装配置(IIS,Apache + PHP + MySQL + Zend Optimizer + phpMyAdmin安装配置).doc
- imageurl数据绑定(imageurl数据绑定).doc
- ie和firefox浏览器css兼容性技巧(IE and Firefox browser CSS compatibility skills).doc
- go for it 七年级(下)期末质量检测英语试卷(去吧七年级(下)期末质量检测英语试卷).doc
- ie6.0、ie7.0 与firefox css兼容的解决方法(IE6.0, IE7.0 and Firefox CSS compatible solutions).doc
最近下载
- 《趣味的手工创意--向日葵》-美术课件.ppt VIP
- 派出所民警先进事迹材料三篇 .doc VIP
- VIVITEK丽讯RU76953使用说明书.pdf VIP
- 原调正谱bE边疆的泉水清又纯钢琴伴奏联考.pdf VIP
- 泳池工程施工设计方案(3篇).docx VIP
- 少儿水粉 玫瑰庄园—美术课件.pptx VIP
- (一模)贵阳市2025年高三年级适应性考试(一)地理试卷(含官方答案).docx
- 《模型构建在高中生物教学中的应用研究》课题研究方案.doc
- 精品解析:四川省成都市武侯区2024-2025学年上学期八年级期末考试数学试题(原卷版).docx VIP
- 苏J9508室外工程-标准设计图集.pdf VIP
文档评论(0)