I am building a custom jQuery plugin for a project I am working on. I want to return an object that is custom to another jQuery plugin...rather than having to make sure that
You can also use getScript function from jQuery.
It could be used with callbacks for success and/or failure like:
$.getScript("somejs.js", function(data, textStatus, jqxhr) {
console.log("callback");
}
$.getScript("somejs.js")
.done(function(script, textStatus) {
console.log("done callback");
})
.fail(function(jqxhr, settings, exception) {
console.log("fail callback");
});
Or without assigning a callback like:
$.getScript("somejs.js");