IE和Firefox在Javascript中用法方面的区别
1.firefox不能对innerText支持。 firefox支持innerHTML但却不支持innerText,它支持textContent来实现innerText,不过默认把多余的空格也保留了。如果不用textContent,如果字符串里面不包含HTML代码也可以用innerHTML代替。 2.禁止选取网页内容: 在IE中一般用js:obj.onselectstart=function(){return false;} 而firefox用CSS:-moz-user-select:none 3.滤镜的支持(例:透明滤镜): IE:filter:alpha(opacity=10); firefox:-moz-opacity:.10; 4.捕获事件: IE:obj.setCapture() 、obj.releaseCapture() Firefox: document.addEventListener("mousemove",mousemovefunction,true); document.removeEventListener("mousemove",mousemovefunction,true); 5.获取鼠标位置: IE:event.clientX、event.clientY firefox:需要事件函数传递事件对象 obj.onmousemove=function(ev)