日期:2014-05-17  浏览次数:20718 次

IE和Firefox浏览器下javascript、CSS兼容性研究

为了将公司的产品在IE和Firefox下达到兼容,前段时间做了如下研究。由于之前准备的就是英文文档,我也懒得再翻译成中文了,呵呵。

首先你要在每个页面执行javascript之前引入下面这个我做好的兼容文件。


IEFirefox.js


1. ???? obj.firstChild/.lastChild/.nextSibling/.childNodes/.previousSibling should be changed.

2. ???? Assign a property “id” to HTML element if it miss “id”

3. ???? Keep parameters case-sensitive between file.js and file.cs

4. ???? Using getElementById(objId) to get a object instead of eval(objId)

5. ???? Add <tr> between <thead>and<th>

6. ???? Change aRows(i).cells to aRows[i].cells

7. ???? Using standard way to get/set customized value

8. ???? Using standard way to remove an option.

9. ???? Firefox doesn’t support Expression in style file.

10. ??????? Change the event onmouseleave() to onmouseout()

11. ??????? Change obj.fireEvent(eventname) to fireEvent(obj,eventname)

12. ??????? Don’t use the command document.readyState!="complete"