IE/FF兼容的问题补充
来源:互联网 发布:点餐用什么软件 编辑:程序博客网 时间:2024/06/06 11:44
含有event的js在FF中运行出错,google了一个方法,给大家共享:
错误:event is undefined
<!-- /* Font Definitions */ @font-face{font-family:宋体;panose-1:2 1 6 0 3 1 1 1 1 1;mso-font-alt:SimSun;mso-font-charset:134;mso-generic-font-family:auto;mso-font-pitch:variable;mso-font-signature:3 135135232 16 0 262145 0;}@font-face{font-family:"/@宋体";panose-1:2 1 6 0 3 1 1 1 1 1;mso-font-charset:134;mso-generic-font-family:auto;mso-font-pitch:variable;mso-font-signature:3 135135232 16 0 262145 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal{mso-style-parent:"";margin:0cm;margin-bottom:.0001pt;text-align:justify;text-justify:inter-ideograph;mso-pagination:none;font-size:10.5pt;mso-bidi-font-size:12.0pt;font-family:"Times New Roman";mso-fareast-font-family:宋体;mso-font-kerning:1.0pt;} /* Page Definitions */ @page{mso-page-border-surround-header:no;mso-page-border-surround-footer:no;}@page Section1{size:612.0pt 792.0pt;margin:72.0pt 90.0pt 72.0pt 90.0pt;mso-header-margin:36.0pt;mso-footer-margin:36.0pt;mso-paper-source:0;}div.Section1{page:Section1;}-->var event = eventTag||window.event; 或者
<!-- /* Font Definitions */ @font-face{font-family:宋体;panose-1:2 1 6 0 3 1 1 1 1 1;mso-font-alt:SimSun;mso-font-charset:134;mso-generic-font-family:auto;mso-font-pitch:variable;mso-font-signature:3 135135232 16 0 262145 0;}@font-face{font-family:"/@宋体";panose-1:2 1 6 0 3 1 1 1 1 1;mso-font-charset:134;mso-generic-font-family:auto;mso-font-pitch:variable;mso-font-signature:3 135135232 16 0 262145 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal{mso-style-parent:"";margin:0cm;margin-bottom:.0001pt;text-align:justify;text-justify:inter-ideograph;mso-pagination:none;font-size:10.5pt;mso-bidi-font-size:12.0pt;font-family:"Times New Roman";mso-fareast-font-family:宋体;mso-font-kerning:1.0pt;} /* Page Definitions */ @page{mso-page-border-surround-header:no;mso-page-border-surround-footer:no;}@page Section1{size:612.0pt 792.0pt;margin:72.0pt 90.0pt 72.0pt 90.0pt;mso-header-margin:36.0pt;mso-footer-margin:36.0pt;mso-paper-source:0;}div.Section1{page:Section1;}-->var event = arguments[0]||window.event;
<!-- /* Font Definitions */ @font-face{font-family:宋体;panose-1:2 1 6 0 3 1 1 1 1 1;mso-font-alt:SimSun;mso-font-charset:134;mso-generic-font-family:auto;mso-font-pitch:variable;mso-font-signature:3 135135232 16 0 262145 0;}@font-face{font-family:Verdana;panose-1:2 11 6 4 3 5 4 4 2 4;mso-font-charset:0;mso-generic-font-family:swiss;mso-font-pitch:variable;mso-font-signature:536871559 0 0 0 415 0;}@font-face{font-family:"/@宋体";panose-1:2 1 6 0 3 1 1 1 1 1;mso-font-charset:134;mso-generic-font-family:auto;mso-font-pitch:variable;mso-font-signature:3 135135232 16 0 262145 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal{mso-style-parent:"";margin:0cm;margin-bottom:.0001pt;text-align:justify;text-justify:inter-ideograph;mso-pagination:none;font-size:10.5pt;mso-bidi-font-size:12.0pt;font-family:"Times New Roman";mso-fareast-font-family:宋体;mso-font-kerning:1.0pt;} /* Page Definitions */ @page{mso-page-border-surround-header:no;mso-page-border-surround-footer:no;}@page Section1{size:595.3pt 841.9pt;margin:72.0pt 90.0pt 72.0pt 90.0pt;mso-header-margin:42.55pt;mso-footer-margin:49.6pt;mso-paper-source:0;layout-grid:15.6pt;}div.Section1{page:Section1;}-->
判断浏览器是否IE的一种方法:
一般常用方法是document.all
if(document.all){
//IE代码
}else{
//其他
}
其实这么做不够,document.all能区分出FireFox,却无法区分Opera,因为Opera支持document.all.
我现在的做法是:
var isIE = document.all && window.external;
Opera不支持window.external,所以这么做就比较保险了。
innerText在FF中不兼容:在FF中换成textContent
- IE/FF兼容的问题补充
- 兼容FF IE的Event
- IE和FF的兼容
- IE 和ff css 兼容遇到的问题
- 火狐FF和IE兼容下innerText的问题处理
- FF和IE兼容的捕获回车事件问题
- JavaScript js 兼容浏览器问题 兼容FireFox(FF)、IE的解决方法
- JavaScript js 兼容浏览器问题 兼容FireFox(FF)、IE的解决方法
- 兼容IE,FF的日历控件
- 兼容FF/IE的insertAdjacentHTML方法
- 兼容ff,ie的键盘事件
- 兼容FF/IE的insertAdjacentHTML方法
- 创建兼容FF,IE的xmlHTTP
- 兼容IE、FF的图片上传预览
- 兼容IE FF的幻灯代码
- 兼容ie和ff的无缝滚动
- 兼容ie和ff的无缝滚动
- JS_兼容IE和FF的写法
- SizeOf 操作
- 单点登陆.NET的实现
- 在vim中使用xdebug调试PHP程序
- ASP.NET安全认证 一
- 获取 Select 值
- IE/FF兼容的问题补充
- ASP.NET安全认证 二
- 将结果输出到文档
- ASP.NET安全认证 三
- Spring 发送邮件
- 做官的技巧!
- ASP.NET安全认证 四
- 昨日之顿首记
- TOP欢迎同学们加入