1) jQuery queries for scripts via AJAX are never cached unless you specify this as an option in the $ .ajax () function. From the doc:
", Boolean
Default: true, false for dataType 'script' and 'jsonp'
If set to false, this will cause the pages you request to not be cached by the browser.
2) I think I need to see some sample code to understand this part of the question.
3) You cannot do anything if $ .getScript () fails. But you should know that $ .getScript () is just a short version of $ .ajax (), equivilant to:
$.ajax({ url: url, dataType: 'script', success: function(data) {
This means that you can implement the error callback to do something smart if the file does not load, that is:
$.ajax({ url: url, dataType: 'script', success: function(data) {
source share