Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here's what my previous research uncovered. I've seen each of these issues prevent a real-world application from working in Firefox. Please feel free to edit.</p> <hr/> <h2>The DOM</h2> <p><code>document.createElement</code> should take only a tag name, but IE lets you pass arbitrary HTML (with attributes, etc)</p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/ms536389(VS.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms536389(VS.85).aspx</a></li> </ul> <p><code>document.getElementById</code> should only find elements with the given <code>id</code>, but IE also returns elements with the given <code>name</code></p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/ms536437(VS.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms536437(VS.85).aspx</a></li> </ul> <p>IE creates implicit global variables for DOM elements, but referencing an element this way in Firefox produces the following warning:</p> <blockquote> <p>"Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead."</p> </blockquote> <ul> <li><a href="http://www.west-wind.com/weblog/posts/677442.aspx" rel="nofollow noreferrer">http://www.west-wind.com/weblog/posts/677442.aspx</a></li> <li><a href="http://code.google.com/p/fbug/issues/detail?id=853" rel="nofollow noreferrer">http://code.google.com/p/fbug/issues/detail?id=853</a></li> </ul> <p>IE's <code>document.all</code> is a collection of all elements in the document. It is not supported by Firefox.</p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/ms537434(v=vs.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms537434(v=vs.85).aspx</a></li> </ul> <p>An Element's text in IE is retrieved using the <code>innerText</code> property. Firefox calls this property <code>textContent</code>.</p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/ms533899(v=vs.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms533899(v=vs.85).aspx</a></li> </ul> <p>IE allows items in collections to be referenced using function syntax (i.e. with parentheses) instead of the normal array indexing syntax (i.e. with brackets). For example, the following works in IE: <code>document.forms(0)</code>. Firefox does not support this usage.</p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/ms537457(v=VS.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms537457(v=VS.85).aspx</a></li> </ul> <p><code>HTMLTableElement</code> <code>rows</code> and <code>cells</code> should refer to <code>HTMLCollections</code>, but IE allows them to be called as functions; Firefox does not.</p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/ms537484%28VS.85%29.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms537484%28VS.85%29.aspx</a></li> </ul> <p>IE defaults <code>insertRow</code>'s <code>index</code> to -1; Firefox errors if the argument is omitted.</p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/ms536457%28VS.85%29.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms536457%28VS.85%29.aspx</a></li> <li><a href="https://developer.mozilla.org/en/DOM/table.insertRow" rel="nofollow noreferrer">https://developer.mozilla.org/en/DOM/table.insertRow</a></li> </ul> <p>The <code>Node.text</code> property is IE-only</p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/ms534677%28VS.85%29.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms534677%28VS.85%29.aspx</a></li> <li><a href="https://developer.mozilla.org/En/DOM/Node.textContent" rel="nofollow noreferrer">https://developer.mozilla.org/En/DOM/Node.textContent</a></li> </ul> <hr/> <h2>Events</h2> <p><code>window.event</code> is an IE-specific way to access event information; it's not supported by Firefox.</p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/ms535863(v=vs.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms535863(v=vs.85).aspx</a></li> <li><a href="http://www.quirksmode.org/js/events_access.html#link3" rel="nofollow noreferrer">http://www.quirksmode.org/js/events_access.html#link3</a></li> </ul> <p>Events are attached to Elements in IE using <code>attachEvent</code>. Firefox uses <code>addEventListener</code>. Note, also, that the names of events are subtly different in each browser.</p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/ms536343(v=vs.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms536343(v=vs.85).aspx</a></li> </ul> <p>In IE it's possible to get the mouse position from non-mouse events, but it's not in other browsers. In addition, the names of the mouse-coordinate properties are not the same in IE and Firefox.</p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/ms533567(v=vs.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms533567(v=vs.85).aspx</a></li> <li><a href="http://msdn.microsoft.com/en-us/library/ms533568(v=vs.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms533568(v=vs.85).aspx</a></li> <li><a href="http://www.quirksmode.org/js/events_properties.html#position" rel="nofollow noreferrer">http://www.quirksmode.org/js/events_properties.html#position</a></li> </ul> <p>IE supports a <code>click</code> method for triggering the <code>onclick</code> event on HTML elements. No such function exists in Firefox.</p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/ms536363(v=vs.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms536363(v=vs.85).aspx</a></li> <li><a href="http://lifescaler.com/2008/04/simulating-mouse-clicks-in-javascript/" rel="nofollow noreferrer">http://lifescaler.com/2008/04/simulating-mouse-clicks-in-javascript/</a></li> <li><a href="http://www.devtoolshed.com/content/fix-firefox-click-event-issue" rel="nofollow noreferrer">http://www.devtoolshed.com/content/fix-firefox-click-event-issue</a></li> </ul> <hr/> <h2>XML</h2> <p>Firefox splits text nodes into 4096-char blocks; IE does not. This means that things like <code>childNodes</code> will be different in IE and Firefox.</p> <ul> <li><a href="https://stackoverflow.com/questions/1967741/is-there-a-4096-character-limit-for-javascript-xml-text-nodes">Is there a 4096 character limit for JavaScript XML text nodes?</a></li> </ul> <p>Internet Explorer defines a <code>parseError.errorCode</code> property on XMLDocuments for detecting parser errors. Firefox loads an XML document that contains error information in the document with <code>documentElement.nodeName=="parsererror"</code>.</p> <p>IE ignores whitespace in XML; <code>firstChild</code> always returns the first <code>ELEMENT_NODE</code></p> <ul> <li><a href="http://www.w3schools.com/dom/prop_element_firstchild.asp" rel="nofollow noreferrer">http://www.w3schools.com/dom/prop_element_firstchild.asp</a></li> <li><a href="https://developer.mozilla.org/en/Whitespace_in_the_DOM" rel="nofollow noreferrer">https://developer.mozilla.org/en/Whitespace_in_the_DOM</a></li> </ul> <p>The <code>Node.xml</code> property is IE-only</p> <ul> <li><a href="http://www.w3schools.com/dom/prop_node_xml.asp" rel="nofollow noreferrer">http://www.w3schools.com/dom/prop_node_xml.asp</a></li> <li><a href="http://www.grange.com.br/dicas-tecnicas/40-lotus/345-dom-xml-wrapper-for-javascript" rel="nofollow noreferrer">http://www.grange.com.br/dicas-tecnicas/40-lotus/345-dom-xml-wrapper-for-javascript</a></li> </ul> <hr/> <h2>Further reading</h2> <ul> <li><a href="http://www.reloco.com.ar/mozilla/compat.html" rel="nofollow noreferrer">http://www.reloco.com.ar/mozilla/compat.html</a></li> <li><a href="https://developer.mozilla.org/en/migrate_apps_from_internet_explorer_to_mozilla" rel="nofollow noreferrer">https://developer.mozilla.org/en/migrate_apps_from_internet_explorer_to_mozilla</a></li> <li><a href="http://www.impressivewebs.com/7-javascript-differences-between-firefox-ie/" rel="nofollow noreferrer">http://www.impressivewebs.com/7-javascript-differences-between-firefox-ie/</a></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload