Hey! I need jQuery compatibility on some projects. How can I make defer loading jQuery? I have to remember that some plugins load jQuery code directly in HTML
For further actions, you may consider blocking this person and/or reporting abuse
Hey! I need jQuery compatibility on some projects. How can I make defer loading jQuery? I have to remember that some plugins load jQuery code directly in HTML
For further actions, you may consider blocking this person and/or reporting abuse
Arindam Majumder -
saifalikhan9 -
zhuyue -
Jagroop Singh -
Top comments (3)
We've used this to help us defer jQuery. I'm not the original author, but I can't find where we got it from right now. Sorry it's minified too. If i find the OP i'll post a follow up link.
You essentially want to queue up the calls to jQuery.ready so that they execute after the page has loaded. This script creates a fake jQuery object, and repeatedly checks for the jQuery.fn property (which means that the jQuery library has loaded). Then it executes the .ready calls in the order they entered the queue.
Try it out, it might need some tweaking but it gets the job done.
Thanks a lot!
Some comments may only be visible to logged-in visitors. Sign in to view all comments.