I have an object like this:
Object
id: "myid"
token: "sometoken"
I need to build a HTTP query-string and get something like this:
http://domain.com/file.html?id=myid&token=sometoken
Any ideas how I can do this?
I have an object like this:
Object
id: "myid"
token: "sometoken"
I need to build a HTTP query-string and get something like this:
http://domain.com/file.html?id=myid&token=sometoken
Any ideas how I can do this?
You can use
$.param()
to create your query-string parameters. This will alertid=myid&token=sometoken
.Here is a demo: http://jsfiddle.net/RdGDD/
And docs: http://api.jquery.com/jquery.param