Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
jQuery.getScript Cached
jQuery.getScriptCached = function( url, options ) {
// Allow user to set any option except for dataType, cache, and url
options = $.extend( options || {}, {
dataType: "script",
cache: true,
url: url
});
// Use $.ajax() since it is more flexible than $.getScript
// Return the jqXHR object so we can chain callbacks
return jQuery.ajax( options );
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment