This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webkitcache = $H(); | |
this.cacheset = function(owner, datarequest, object) { | |
// assigns object to webkitcache global hash | |
if ($(object)) { | |
// part of DOM, create clone | |
webkitcache.set(owner + '_' + datarequest, object.cloneNode(true)); | |
} | |
else { | |
webkitcache.set(owner + '_' + datarequest, object ); | |
} | |
} | |
this.cacheget = function(owner, datarequest) { | |
// checks to see if cache for datarequest exists | |
if (webkitcache.get(owner + '_' + datarequest)) { | |
return true; | |
} | |
return false; | |
} | |
this.cacheoutput = function(owner, datarequest, object) { | |
if ($(object)) { | |
// replace entire object with cached object | |
$(object).replace(webkitcache.get(owner + '_' + datarequest).cloneNode(true)); | |
} | |
else { | |
// updating using cache contents | |
$(object).update(webkitcache.get(owner + '_' + datarequest)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment