Firefox兼容性问题
来源:互联网 发布:张子萱的淘宝店 编辑:程序博客网 时间:2024/06/16 07:04
1、firefox不支持innerText,outerText,outerHTML
解决思路:a)用innerHTML替换innerText
b)为Firefox扩展innerText属性,详细参考:Firefox 不支持 DOM 对象的 outerHTML、innerText、outerText 属性(http://www.w3help.org/zh-cn/causes/SD9017)
2、firefox不支持onfocusin,onfocusout
参考:http://help.dottoro.com/ljggspvo.php
http://stackoverflow.com/questions/13516931/prevent-cursor-moving-on-text-input
Instead of onfocus
rather use onfocusin
, that'll make your code to work.
EDIT
I just realized, that there is no focusin
in Firefox. Hence you need something heavier.
The script:
function changeValueOnFocus (e, elm) { elm = elm || this; elm.value = 1234; return; }window.onload = function () { if (window.onfocusin === undefined) { document.getElementById('someinput').addEventListener('focus', changeValueOnFocus, false); } return;}
and for input
you'll need an id
:
<input id="someinput" maxlength="5" onfocusin="changeValueOnFocus(event, this);" type="text" />
Now this supposed to be a cross-browser solution.
在对radio input进行操作时,会用到document.all来选择某个值,比如:
document.all["carType"][0].checked = true;
但是在firefox里不支持document.all,就可以用getElementsByName等来代替:
if (document.all) { document.all["carType"][0].checked = true; } else document.getElementsByName("carType")[0].checked = true;
- Firefox兼容性问题
- event ie firefox 兼容性问题
- selenium geckodriver firefox兼容性问题
- IE与FireFox的兼容性问题
- IE与FireFox的兼容性问题
- IE VS firefox 兼容性问题之一
- IE6、 IE7、IE8、Firefox兼容性问题
- IE与FireFox的兼容性问题
- IE6、IE7、IE8、Firefox兼容性问题
- IE6、 IE7、IE8、Firefox兼容性问题
- firefox ie table 布局 兼容性问题
- IE与FireFox的兼容性问题
- Mozilla Firefox与IE浏览器的兼容性问题
- Javascript的IE和Firefox兼容性问题集合
- css解决IE6,IE7,firefox兼容性问题
- [转载]IE与FireFox的兼容性问题
- IE与FireFox在javascript中兼容性问题
- Javascript的IE和Firefox兼容性问题
- hdu 1171 bit 1014
- android2.3新增API StrictMode介绍
- 对static、extern和文件包含的理解1
- 根据给定日期数计算星期数
- hdoj1098简单题、找规律
- Firefox兼容性问题
- 腾讯开放真相
- 驱动程序结构学习
- 一个成功只属于 1% 的真实世界
- hibernate.hbm2ddl.auto 的设置
- 图像分割之(二)Graph Cut(图割)
- 子查询
- openacs
- Linux修改文件时候出现崩溃,产生了一个.swap交换文件,如何修复?