ded/script.js — pull request #35 by rykov (2012-02-27 07:00:16+00:00)
Title: Allow to manually trigger completion via $script.done

Third-party libraries on the web have their own bootstrapping logic and attaching a callback to the 'load' event of the _script_ tag is not enough. These include Facebook, Google Maps, etc

To tie dependencies to those libraries, you need to manually attach the callbacks. Here's what I do for Facebook:

window.fbAsyncInit = function() { $script.done("facebook") }
$script("http://www.facebook.com/.../all.js")

So if the Facebook library loads other scripts before initializing itself, I'm now able to wait until they finish their bootstrap to continue mine