RemediateIE

  • Revision slug: RemediateIE
  • Revision title: RemediateIE
  • Revision id: 188258
  • Created:
  • Creator: Riboribo
  • Is current revision? No
  • Comment

Revision Content

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 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; 

Revision Source

<h2 name="Remediating_Internet_Explorer_to_Support_W3C_API"> Remediating Internet Explorer to Support W3C API </h2>
<p>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.
</p><p>Here is a crude example of one such remediation:
</p>
<pre>  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; 
</pre>
Revert to this revision