- 1、本文档共11页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
ie和firefox的js兼容性整理(JS compatibility with IE and Firefox)
ie和firefox的js兼容性整理(JS compatibility with IE and Firefox)
the 代替 以下以 internet explorer, firefox 代替 mozzila 以 mf
1. document.form.item 问题
(1) 现有问题.
现有代码中存在许多 document.formname.item (itemname 这样的语句, 下运行 不能在 fm )
(2) 解决方法.
改用 document.formname.elements elementname]
(3) 其它
参见 2
2. 集合类对象问题
(1) 现有问题.
现有代码中许多集合类对象取用时使用 (), the 能接受, mf 不能.
(2) 解决方法.
改用 [] 作为下标运算.如: document.forms (formname) 改为 formname document.forms [].
又如: document.getelementsbyname (inputname) (1) (inputname 改为 document.getelementsbyname) [1]
(3) 其它
3. window.event
(1) 现有问题.
使用 window.event 上运行 无法在 mf
(2) 解决方法.
mf 的 event 只能在事件发生的现场使用, 此问题暂无法解决.可以这样变通.
原代码 (可在ie中运行).
input type = button name = somebutton value = 提交 onclick = javascript: gotosubmit /
...
script language = javascript
gotosubmit () ()
...
alert (window.event); / / use window.event
...
}
/ td
新代码 (可在ie和mf中运行).
input type = button name = somebutton value = 提交 onclick = javascript: gotosubmit (event).
...
script language = javascript
gotosubmit () (net)
poss = net? net (window.event? window.event: null).
...
alert (vte); / / use net
...
}
/ td
此外, 如果新代码中第一行不改, 与老代码一样的话 (即 gotosubmit 调用没有给参数), 则仍然只能在ie中运行, 但不会出错.所以, 部分仍与老代码兼容 这种方案 dwt.
4. 对象的 id 作为对象名的问题 html
(1) 现有问题
the 中 在 html document 的下属对象变量名直接使用.在 中不能 对象的 id 可以作为 fm.
(2) 解决方法
用 getelementbyid (idname) 代替 idname 作为对象变量使用.
5. 用idname字符串取得对象的问题
(1) 现有问题
在ie中, 利用 eval (idname) 可以取得 id 为 idname 的 html 对象, 在mf 中不能.
(2) 解决方法
用 getelementbyid (idname) 代替 eval (idname).
6. 对象 id 相同的问题 变量名与某 html
(1) 现有问题
在 mf 中, 因为对象 id 不作为 所以可以使用与 html html 对象的名称, 对象 id 相同的变量名, 中不能.
(2) 解决方法
在声明变量时, 一律加上 以避免歧义 这样在 var, the 中亦可正常运行.
此外, 最好不要取与 html 对象 id 相同的变量名, 以减少错误.
(3) 其它
参见 问题4
7. event.x 与 event.
Y problem
(1) existing problems
In IE, the event object has the X and Y attributes, not in the MF.
(2) solutions
In MF, event.x is equivalent to event.pageX. But not in event.pageX IE.
Therefore, the use of event.clientX instead of event.x. This variable is also available in IE.
There is a subtle differen
您可能关注的文档
- 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
- 2011考研必备考研英语每年都出现的单词(2011, postgraduate entrance examination must English for postgraduate entrance examination every year).doc
- 2011护士资格考试资料(2011 nurse qualification examination data).doc
- 2011考研生应做好生理和心理上的双重准备(2011, postgraduate students should do both physical and psychological preparation).doc
最近下载
- 固体废物管理知识培训课件.ppt VIP
- Midjourney 人工智能AI绘画教程:从娱乐到商用 课件 第1章 Midjourney 人工智能绘画简介.pptx
- 某啤酒厂废水处理工艺设计(4000m3d.docx
- 2025年无锡工艺职业技术学院单招职业技能测试题库及1套参考答案.docx VIP
- 高中课件:晶胞投影与原子分数坐标.ppt
- 高考“散文六种常考句段作用”题例解.doc VIP
- 2025年国航机务系统AMECO技术员岗位校园招聘笔试参考题库附带答案详解.pdf
- 中国翻译服务规范.PDF
- (高清版)DB33∕T 2080-2017 文化馆服务规范 .pdf VIP
- 2024年无锡工艺职业技术学院单招职业技能测试题库(全优).docx VIP
文档评论(0)