I have a javascript object that I need to flatten into a string so that I can pass as querystring, how would I do that? i.e:
{ cost: 12345, insertBy: \'testUse
You want jQuery.param:
var str = $.param({ cost: 12345, insertBy: 'testUser' }); // "cost=12345&insertBy=testUser"
Note that this is the function used internally by jQuery to serialize objects passed as the data argument.
data