\'bar\',
\'baz\'=>\'boom\',
\'cow\'=>\'milk\',
\'php\'=>\'hypertext processor\');
Try the jQuery query plugin. It's pretty intuitive. You can use get and set accessors to read and modify the query string:
var cow = $.query.get('cow');
$.query.set('cow', 'goat');
You can create a new query object from an existing string:
var fromVar = $.query.load('?cow=milk')
var cow = fromVar.get('cow'); // milk
You can also create an empty object:
var newQ = $.query.empty();
newQ = newQ.set('first', 'value'); // "?first=value"