1 2// Extend jQuery with a cachedScript method 3(function($) { 4 var scriptCache = {}; 5 6 $.cachedScript = function(url, options) { 7 // Allow user to set any option except for dataType, cache, and url 8 options = $.extend(options || {}, { 9 dataType: "script", 10 cache: true, 11 url: url 12 }); 13 14 if (!scriptCache[url]) { 15 scriptCache[url] = $.ajax(options).done(function() { 16 //console.log('Loaded script:', url); 17 }).fail(function(jqxhr, settings, exception) { 18 //console.log('Failed to load script:', url); 19 }); 20 } 21 return scriptCache[url]; 22 }; 23})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.