Differences between Firefox and IE
This is my first post of many and am new to JS. I'm familiar with Java so I shouldn't be too lost. What I'm about to do is add support for a web app from Firefox to IE that uses OpenLayers.
I've searched and found a link to this site from another thread which had a list of supported functions and what not here: http://www.quirksmode.org/dom/w3c_core.html
From what I've read in the last hour it seems as though I will have to use some browser sniffing (isMozilla, isIE8, etc) and have multiple conditions (if-else's) in my functions to use the proper calls. Does anyone have extra material that contains differences between IE and firefox? Someone mentioned to me that in lists IE doesn't support trailing commas but ff does.. Things like this would be very helpful
No one, except people from Quirksmode, had the patience and endurance to try to catalogue all the differences, bugs, incomplete implementations, alternative methods between the browsers. It is not only IE vs FF, it is about all the browsers, platforms and versions. On one hand, there is not a single browser which follows entirely the standards. On the other hand different versions have different behaviors.
As a general rule, you should start by studying the standards and code accordingly. Afterward, when coding, you will encounter, now and then, on-the-dot problems. Usually related with IE, but not only. Google for or put your cross-browser problem in a Forum. Most of the time you should use an if/else statement, but based on the existence of a method/object, not on a browser detector. Detectors are not so reliable. Use them only when there is absolutely no other way.
Unfortunately, there is no comprehensive book or site about all the cross-browser lacks of consistency valuable now. There are much too many and they change much too fast. Don't mention about the future problems Quirksmode remains the only project, even incomplete, about all these.
Last edited by Kor; 02-08-2011 at 05:27 AM.
libs like jQuery provide abstract interfaces that work the same in all browsers.
usually you don't need if/else splits to handle IE diffs: most often IE has an identical method, it's just called a different name. You can conditionally create a pointer to the functionality and use that abstraction in your flow rather than re-forking every time.
for example, the classic ajax object fetcher:
return !window.XMLHttpRequest ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest;
That is an if/else statement, except that is written within a ternary operator shortcut
Originally Posted by rnd me
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)