MCPcopy Index your code
hub / github.com/prototypejs/prototype / retrieve

Function retrieve

src/prototype/dom/dom.js:3158–3168  ·  view source on GitHub ↗

* Element.retrieve(@element, key[, defaultValue]) -> ? * * Retrieves custom metadata set on `element` with [[Element.store]]. * * If the value is `undefined` and `defaultValue` is given, it will be * stored on the element as its new value for that key, then returned.

(element, key, defaultValue)

Source from the content-addressed store, hash-verified

3156 * stored on the element as its new value for that key, then returned.
3157 **/
3158 function retrieve(element, key, defaultValue) {
3159 if (!(element = $(element))) return;
3160 var storage = getStorage(element), value = storage.get(key);
3161
3162 if (Object.isUndefined(value)) {
3163 storage.set(key, defaultValue);
3164 value = defaultValue;
3165 }
3166
3167 return value;
3168 }
3169
3170
3171 Object.extend(methods, {

Callers

nothing calls this directly

Calls 2

$Function · 0.85
getStorageFunction · 0.85

Tested by

no test coverage detected