jQuery (document).ready() event

0 votes
260 views
added Apr 3, 2018 in jQuery by LC Marshal Captain (25,790 points)
edited Apr 16, 2019 by LC Marshal

The .ready() method offers a way to run JavaScript code as soon as the page's Document Object Model (DOM) becomes safe to manipulate. This will often be a good time to perform tasks that are needed before the user views or interacts with the page, for example to add event handlers and initialize plugins. When multiple functions are added via successive calls to this method, they run when the DOM is ready in the order in which they are added. As of jQuery 3.0, jQuery ensures that an exception occuring in one handler does not prevent subsequently added handlers from executing. src: https://api.jquery.com/ready/

$(document).ready(function() {
//your code
});
lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...