Skip to content

Instantly share code, notes, and snippets.

@jblac
Created January 17, 2013 16:39
Show Gist options
  • Save jblac/4557362 to your computer and use it in GitHub Desktop.
Save jblac/4557362 to your computer and use it in GitHub Desktop.
function include(script) {
$.ajax({
url: script,
dataType: "script",
async: false,
success: function() {
// everything works fine
},
error: function() {
throw new Error("Could not load script " + script);
}
});
}
include("/inc/js/jquery-ui.js");
include("/inc/js/functions.js");
include("/inc/js/plugins.js");
include("/inc/js/editor.js");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment