Closed blowsie closed 9 years ago
Wouldn't jquery ajax cache things by default?
I did some experiment. I think if you would like to call the localize function multiple times after initialization. The cache will help out. But blowsie's code seems not working by caching the ajax object.
I end of using the "$.localize.data" (currently it seems useless):
jsonCall = function(file, pkg, lang, level) {
if($.localize.data[pkg+lang+level]) {
intermediateLangData = $.localize.data[pkg+lang+level];
notifyDelegateLanguageLoaded(intermediateLangData);
return loadLanguage(pkg, lang, level + 1);
}
else {
... <-- Original function content goes here.
}
};
Normal HTTP caching applies, which is handled by the browser and web server.
I think the plugin should really be cahing the json file something like this...
var fileCache = {};
I dont know coffee otherwise i would submit a pull