I get some scripts asynchronously on my login page:
$.when(
$.getScript("/Scripts/View/scroll-sneak.js"),
$.getScript("/Scripts/kendo/kendo.custom.min.js"),
$.Deferred(function (deferred) {
$(deferred.resolve);
})
).done(function (res1, res2) {
if (res1[1] == "success") {
}
if (res2[1] == "success") {
}
alert('all script loaded...');
});
I have two queries here:
- How can I leverage browser cache here, as getScript always take fresh script.
- How can I have promise that this script will be available to all pages on same domain.
Alternate solutions are welcome.