Skip to content

webfactory/document-ready

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

documentReady Utility

The documentReady utility is a simple JavaScript function that allows you to execute a callback function once the HTML document has fully loaded. This is particularly useful for ensuring that asynchronously loaded scripts run only after the DOM is ready, preventing potential issues with elements not being available when your code executes.

Installation

npm install @webfactoryde/document-ready

Usage

Import the documentReady function in your module(s) and pass a callback:

// your module
import documentReady from '@webfactoryde/document-ready';

function init() {
    // do stuff
}

documentReady(function() {
    init();
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published