-
-
Save gerrit/1380551 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getScript = jQuery.getScript; | |
jQuery.getScript = ( resources, callback )-> | |
deferreds = [] | |
counter = 0 | |
for resource in resources deferreds.push getScript( resource, -> counter++ ) | |
jQuery.when.apply( null, deferreds ).then -> callback && callback(); | |
deps = [ | |
"http://documentcloud.github.com/backbone/backbone-min.js", | |
"http://documentcloud.github.com/underscore/underscore-min.js" | |
] | |
jQuery.getScript deps, ( jqXhr )-> | |
console.log jqXhr | |
console.log [ _, Backbone ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment