Skip to content

Latest commit

 

History

History
82 lines (67 loc) · 2.19 KB

README.md

File metadata and controls

82 lines (67 loc) · 2.19 KB

Obsolete

These are basically unmaintained dead ends. Use at your own risk.

W3C Web Storage

script - spec - adapted from Remy Sharp

storage = window.localStorage
storage = window.sessionStorage
storage.clear()
valueString = storage.getItem(keyString)
valueString = storage.key(index)
storage.removeItem(keyString)
storage.setItem(keyString, valueString)
storage.length

W3C Workers

script - spec - just for kicks; you probably don't want to use this

Console

script - unit tests - de facto standard in modern browsers based on FireBug Console API

console.log(messageObject, arguments...); // and variations: debug, info, warn, error
console.assert(assertion, messageObject, arguments...);
console.count(name);
console.time(name); console.timeEnd(name);
console.group(name); console.groupEnd();
console.trace();
console.clear();

Cookie API

script - Adam Barth's Cookie API proposal - abandoned

var cookie = document.getCookie(name, callback);
alert(cookie.name);
alert(cookie.value);

var cookieArray = document.getAllCookies(callback);
document.setCookie(cookie, errorCallback);
document.deleteCookie(name, errorCallback);

DOMException (helper)

script - demo page -

Creates a native DOMException of the specified type if possible, otherwise a similar looking object. Useful when implementing other polyfills.

exception = DOMException.create(code)

sprintf (other)

script - unit tests - used for a few C-to-JavaScript porting projects

var str = sprintf("Foo %s bar %d", "hello", 123);