Visit Mozilla.org

RemediateIE

From MDC

This page has been flagged by editors or users as needing technical review

Until it is fully reviewed, it may contain inaccurate or incorrect information.

[edit] Remediating Internet Explorer to Support W3C API

IE doesn't support all the W3C DOM API. Some of the missing functions can be added by defining JavaScript functions to provide the equivalent function. This allows the programmer to write his code using the standard API and have it work on IE and Mozilla.

Here is a (very) crude example of one such remediation:

  function addEventListener(evtName, func, useCapture) {
    document["on"+evtName] = func;
  } // end of addEventListener


  function removeEventListener(evtName, func, useCapture) {
    document["on"+evtName] = null;
  } // end of removeEventListener

  // Add these functions to the document object
  document.addEventListener = addEventListener; 
  document.removeEventListener = removeEventListener;