jquery string url

jquery build http query string

I have an object like this:

id: "myid"
token: "sometoken"

I need to build a HTTP query-string and get something like this:

Any ideas how I can do this?

​var obj = {
id : 'myid',
token : 'sometoken'

You can use $.param() to create your query-string parameters. This will alert id=myid&token=sometoken.

This function is used internally to convert form element values into a
serialized string representation.

Here is a demo:

And docs: