1

I know there is a lot of cross browser difficulties involved with loading external scripts asynchronously and providing callback functionality for when the script has been loaded. After quite a bit of research I've found several pretty sizeable JavaScript libraries that includes this functionality.

But what I'm searching for is a small library that is designed specifically for this task that I can embed into my application. The closest I've seen so far is Bezen's load script loading module, but I don't know how reliable it is. My application must support all browsers with any market share to speak of, which unfortunately includes IE6.

I'm thinking there's probably a sleek tried & true JavaScript library out there that everybody uses but I can't find. Thanks for all suggestions, the best one will be marked as the accepted answer.

4
  • What's wrong with LABjs? Commented Aug 29, 2012 at 12:33
  • Any elaboration on that down vote? @raina77ow: LABjs looks nice, I'll check it out Commented Aug 29, 2012 at 12:43
  • Well, actually I thought LABjs was rejected by you as well, just wanted to know the reasons why. ) We started to use LABjs in our project to provide modularity, but right now are thinking about using RequireJS; it's sizy a bit, but it's well worth it for big projects with complex module dependencies. ) Commented Aug 29, 2012 at 12:56
  • @raina77ow: require.js doesn't seem like it's designed for what I need. All I need is to be able to add jQuery to the page from Google CDN, then have a callback function run when the script has been loaded and run and jQuery is available. I don't need a full-fledged AMD library for that. LABjs looks more like it and I'll be sure to try it out. I still don't know what the down vote is all about though. Commented Aug 30, 2012 at 5:30

2 Answers 2

1

perhaps http://requirejs.org/ ?

Edit: according to your question comments, you to need this:

http://www.yterium.net/jQl-an-asynchronous-jQuery-Loader (700bytes minified and gziped)

jQuery will be loaded without blocking browser rendering, and during this all inline calls to $(document).ready() will be queued.
As soon as jQuery is ready, all queued inline calls will be run respecting their initial order

Perhaps the downvote was because you can find the answer to your question with a simple google search: https://www.google.com/search?q=async+jquery+load

Sign up to request clarification or add additional context in comments.

Comments

0

I ended up using SidJS. All it does is, straight to the point, load a JS or CSS file by URL and provides callback functionality for when the file is loaded and ready.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.