Javascript equivalent of jQuery.param.