www.webdeveloper.com
Results 1 to 4 of 4

Thread: Differences between Firefox and IE

  1. #1
    Join Date
    Feb 2011
    Posts
    1

    Differences between Firefox and IE

    Hi all,

    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

    Thanks,
    Chris

  2. #2
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    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 04:27 AM.

  3. #3
    Join Date
    Jul 2008
    Location
    urbana, il
    Posts
    2,787
    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:

    Code:
    function getAjax(){
       return  !window.XMLHttpRequest ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest;
    }

  4. #4
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Quote Originally Posted by rnd me View Post
    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:

    Code:
    function getAjax(){
       return  !window.XMLHttpRequest ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest;
    }
    That is an if/else statement, except that is written within a ternary operator shortcut

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles