dom-ready

1.0.6 • Public • Published

Cross-Browser DOM Ready Handler

A minimalist, cross-browser "DOM Ready" event handler.

Example

The test.html is minimal and shows a typical usage.
But it's really very simple, much like the following code snippet:

<!DOCTYPE html>
<html>
  <head>
    <script type="text/javascript" src="/path/to/dom-ready.js"></script>
    <script type="text/javascript">
      // When DOM is ready, this function is called and
      // 'document' is passed to it.
      // 'this' is pointing to current scope ('window', in this case.)
      domReady(function(document, window) {
        ...
      });
    </script>
  </head>
  <body>
    ...
  </body>
</html>

Sources

The source code has been meticulously gathered from various authors (list follows) and compiled in this minimal closure. Once minified, the script is merely a few hundred bytes long.

domready, by Elias Torres
IEContentLoaded, by Diego Perini
onDOMContentLoaded, by Ilya Kantor (Russian)
domassistant, by Robert Nyman
DOMContentLoaded, by Microsoft Corp.
domcontentloaded, by Tanny O'Haley

Terms of Use

MIT License

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.6
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.6
    2
  • 1.0.5
    0
  • 1.0.4
    0

Package Sidebar

Install

npm i dom-ready

Weekly Downloads

2

Version

1.0.6

License

MIT

Last publish

Collaborators

  • noordawod