jQuery: Enforce order of execution of document.ready() calls -
i'm working on codebase multiple blocks of code setting behavior on document.ready() (jquery). there way enforce 1 specific block called before of others?
background: need detect js errors in automated testing environment, need code starts logging js errors execute before other js code executes.
document.ready() callbacks called in order registered. if register testing callback first, called first.
also if testing code not need manipulate dom, may able run code parsed , not wait until dom ready run before other document.ready() callbacks called. or, perhaps run part of testing code , defer part uses dom until document.ready().
another idea (for testing purposes only) run modified version of jquery added flag document.ready() when passed , set true indicated call function first or add new method document.readyfirst() call function first. involve minor changes document.ready() processing code in jquery.
Comments
Post a Comment