What event does JQuery $function() fire on?

It fires when the document has been parsed and is ready, and is the equivalent of $(document).ready(function () { }).

The obvious benefit is that having your script tag before other elements on the page means that your script can interact with them even though they’re not available at parse time. If you run your script before elements have been parsed and the document is not ready, they will not be available for interaction.

Leave a Comment