网站大量收购独家精品文档,联系QQ:2885784924

ie和firefox的js兼容性整理(JS compatibility with IE and Firefox).doc

ie和firefox的js兼容性整理(JS compatibility with IE and Firefox).doc

  1. 1、本文档共11页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 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

您可能关注的文档

文档评论(0)

f8r9t5c + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:8000054077000003

1亿VIP精品文档

相关文档