A jQuery plugin that saves strings to document.location.hash and gets them back for you.
Set variables:
$.hash('foo',42); //sets the hash to #foo=42 (returns 42)
$.hash('bar','asdf'); //sets the hash to #foo=42&bar=asdf (returns 'asdf')
$.hash('bar','qwerty'); //sets the hash to #foo=42&bar=qwerty (returns 'qwerty')
Get variables:
$.hash('foo'); //returns '42'
$.hash('bar'); //returns 'qwerty'
$.hash('doesntexist'); //returns undefined
To the extent possible under law, Samuel Bailey has waived all copyright and related or neighboring rights to this work. This work is published from: New Zealand.