aim12340 / jQuery-Before-Ready

Add a jQuery .ready() handler that will execute before existing .ready() handlers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jQuery-Before-Ready

Add a jQuery .ready() handler that will execute before existing .ready() handlers.

jQuery exeutes .ready() functions in source code order. Sometimes we need to execute a .ready() function early.

Instructions

Load jquery-before-ready.js immediatley after jQuery, or as as early as possible.

Use .beforeReady() instead of .ready(). You should still use .ready() as normal for scripts that do not need early execution.

Example

$.beforeReady(function() {
    alert("Ere I am JH")
});

About

Add a jQuery .ready() handler that will execute before existing .ready() handlers.

License:MIT License


Languages

Language:JavaScript 100.0%