536 Part III: Advanced Topics
MethodDescriptionExampleadd(key,value,persistenceObject [, store])Stores the value specified as a string at the key specified in the appropriate storage system bound to the persistence object. In the case of Internet Explorer, thestoreparameters may also be passed in otherwise a default value is supplied.AjaxTCR.storage.add("fortknox","lots of gold",persistObj)get(key,persistanceObject[,store])Retrieves data at the passed key from the storage system related to the persistenceObject.var treasure = AjaxTCR.storage.get("fortknox", persistObj);alert(treasure); /* shows "lots of gold" */getAll(persistenceObject[,store])Retrieves all data from the storage system referenced by the persistenceObject.var allTreasure = AjaxTCR.storage.getAll(persistObj);init()Initializes the data store for holding persisted data. Returns a handle to the persistence object. Persistence system tries to accommodate Firefox and Internet Explorer persistence forms and degrades to cookies if necessary.var persistObj = AjaxTCR.storage.init();clear(persistenceObject[,store])Clears all the items out of the storage system related to the persistenceObject.AjaxTCR.storage.clear(persistObj)remove(key,persistanceObject[,store])Removes the data from the storage system related to the passedkey.AjaxTCR.storage.remove("fortknox", persistObj);/* no more gold */TABLE10-4Methods of AjaxTCR.storage