Projects

Element Prototype Extension - Installation

To use EPE you need to follow these simple steps

  1. Make sure your HTML document has a proper DOCTYPE declaration. As all JSLab scripts EPE is designed to work in standards mode and might fail in quirks mode.
    If you are targeting IE 6 and want a XHTML doctype don't use
    <?xml version="1.0" encoding="UTF-8"?>
    as it is not supported until IE 7. Use
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    instead.
  2. Download the newest version of the HTMLElement interface from the JSLab DOM Correction (JDC) script and put it on your server. You can of course include any other JDC module you prefer.
  3. Add the following code segment to the header portion of your HTML file (replace x.y.z with the version you are downloading):

    <script type="text/javascript" src="jdc.x.y.z.js"></script>

  4. Make sure JDC is the first JavaScript file you load.
  5. Before the finishing </body> tag you enter the following code
    <script type="text/javascript">
      if (window.EPE) {
        EPE.__R1 = document.documentElement.childNodes[1].onload;
        document.documentElement.childNodes[1].onload = EPE.init;
      }
    </script>
    

Example of installing EPE

The following is how a HTML file could look with EPE implemented (replace x.y.z with the version you are downloading)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
  <head>
    <script type="text/javascript" src="js/jdc.x.y.z.js"></script>
    <!-- Additional JavaScripts go here -->
  </head>
  <body>
  
  <!-- Your HTML code goes here -->
  
    <script type="text/javascript">
      // Only run in IE
      if (window.EPE) {
        EPE.__R1 = document.documentElement.childNodes[1].onload;
        document.documentElement.childNodes[1].onload = EPE.init;
      }
    </script>
  </body>
</html>