Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tubalmartin/ondomready
An AMD compatible module to detect when the DOM is ready. Based on jQuery's source code.
https://github.com/tubalmartin/ondomready
Last synced: about 2 months ago
JSON representation
An AMD compatible module to detect when the DOM is ready. Based on jQuery's source code.
- Host: GitHub
- URL: https://github.com/tubalmartin/ondomready
- Owner: tubalmartin
- Created: 2012-04-07T19:06:36.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2013-10-03T00:31:48.000Z (over 11 years ago)
- Last Synced: 2024-11-10T15:50:57.988Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 119 KB
- Stars: 88
- Watchers: 7
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# onDomReady
A function that allows you to safely initialize your code when the DOM is ready.
* **Bullet proof**: Based on jQuery's `ready()` method (same behavior & reliability).
* Easy to maintain: Since onDomReady is based on jQuery's implementation, whenever the jQuery team improves it onDomReady will be updated.
* Browser support: IE6+
* AMD compatible (anonymous module = more portable),
* MIT license.## How to use:
```js
// Functions passed to onDomReady will be executed as soon as the DOM is ready.// Execute this function ASAP
onDomReady( function() {
// Your code
} );// Define a callback
var init = function() {
// Your code
};// Execute the init function ASAP
onDomReady( init );// Get the version of onDomReady (string)
var version = onDomReady.version; // "1.4.0"// Check at anytime whether DOM is ready
onDomReady.isReady(); // returns true or false (version 1.4.0+)
```## Changelog
**3 Oct 2013**
Version 1.4.0: based on jQuery 1.10.x but keeping support for IE6+**13 Jun 2013**
Version 1.3: based on jQuery 1.10.x but keeping support for IE6+**18 Sep 2012**
Version 1.2: based on jQuery 1.8.1**11 Aug 2012**
Version 1.1: based on jQuery 1.8.0**8 Apr 2012**
Version 1.0: based on jQuery 1.7.2