Javascriptfunction是否因浏览器而异?
我想知道一些关于Javascript的事情。 Javascriptfunction或行为是否会因浏览器而改变?
当我使用Javascript XMLHttpRequest
upload
方法时,我注意到Internet Explorer发送小字节但Firefox和Google Chrome发送大字节。 因此,当我使用Firefox或Chrome发送大数据时,服务器正在提供OutOfMemory
exception。
我正在编辑带有图像细节的post。
没有Javascriptfunction不会从浏览器更改为浏览器,它取决于他们的Javascript渲染机器 (解释器是不同的)。
例如:
- 谷歌 – v8引擎
- Safari – JavaScriptCore
是的,有一些差异(实际上是一个hanful)
这里有些例子
1-获得浮动的支持率
因为float是一个保留关键字,你可以访问它,即:
document.getElementById("id").style.styleFloat = "left";
在火狐中它将是:
document.getElementById("id").style.cssFloat = "left";
2 – 访问类属性,您可以执行以下操作,即:
document.getElementById("id").getAttribute("className");
在火狐中:
document.getElementById("id").getAttribute("class");
这些是我有过的经历。 但现在大多数人都在使用jquery,所以不必担心这些。 但这里有一些关于它们的文章
http://www.impressivewebs.com/7-javascript-differences-between-firefox-ie/
http://www.willowdesign.info/blog/tag/javascript-browser-differences/
JS跨浏览器的不一致/差异
http://technologypost.blogspot.com/2008/07/ie-vs-firefox-javascript-differences_05.html