<?php
$data = array('foo'=>'bar',
'baz'=>'boom',
'cow'=>'milk',
'php'=>'hypertext processor');
echo http_build_query($data);
/* Output:
foo=bar&baz=boom&cow=milk&php=hypertext+processor
*/
How to do similar thing in javascript,say, get the query string from the array ,and convert the array to query string?
UPDATE
the jquery plugin is not working:
var fromVar = $.query.load('?cow=milk')
fromVar.set('first', 'value');
fromVar.toString()
It outputs ?cow=milk
while I want it to be ?cow=milk&first=value