本文介绍了Javascript功能会因浏览器而改变吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道有关Javascript的一些信息.浏览器会更改Javascript功能或行为吗?

I wonder something about Javascript. Does Javascript features or behaviors change by browsers?

当我使用Javascript XMLHttpRequest upload方法时,我注意到Internet Explorer发送小字节,但是Firefox和Google chrome发送大字节.因此,当我使用Firefox或Chrome发送大数据时,服务器给出了OutOfMemory异常.

While I was working Javascript XMLHttpRequest upload method, I noticed that Internet Explorer sending small bytes but Firefox and Google chrome sending big bytes. So while I was sending big data with Firefox or Chrome, server is giving OutOfMemory exception.

我正在编辑带有图片详细信息的帖子.

推荐答案

是的,有一些区别(实际上是一种幻想)

yes there is some differences (a hanful actually)

这是一些例子

因为float是保留关键字,因此您可以通过以下方式访问它:

because float is a reserved keyword you can access it in ie with:

document.getElementById("id").style.styleFloat = "left";

在狐狸中会是:

document.getElementById("id").style.cssFloat = "left";

2-要访问类属性,您可以在ie中执行以下操作:

document.getElementById("id").getAttribute("className");

在狐狸中:

document.getElementById("id").getAttribute("class");

这些是我经历过的事情.但是现在大多数人都在使用jquery,因此不必担心这些.但是这里有一些关于它们的文章

these are the things that i had an experience with . but mostly every one is using jquery now so no need to worry about those . but here are some articles about them

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

这篇关于Javascript功能会因浏览器而改变吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 11:05