You want $.param()
: http://api.jquery.com/jQuery.param/
Specifically, you want this:
var data = { one: 'first', two: 'second' };
var result = $.param(data);
When given something like this:
{a: 1, b : 23, c : "te!@#st"}
$.param
will return this:
a=1&b=23&c=te!%40%23st
More Related Contents:
- Convert form data to JavaScript object with jQuery
- Serializing to JSON in jQuery [duplicate]
- How can I add or update a query string parameter?
- Get querystring from URL using jQuery [duplicate]
- How to send JSON instead of a query string with $.ajax?
- Stringify (convert to JSON) a JavaScript object with circular reference
- Get query string parameters url values with jQuery / Javascript (querystring)
- How do I use jQuery’s form.serialize but exclude empty fields
- Modifying a query string without reloading the page
- Difference between $.post and $.ajax?
- Updating existing URL querystring values with jQuery
- I want to make first option in dropdown to display as a placeholder
- How to have html popup appear over main html page?
- jquery get id of input selected text
- How to debug JavaScript / jQuery event bindings with Firebug or similar tools?
- What is the dollar sign in Javascript, if not jQuery
- jQuery $(“#radioButton”).change(…) not firing during de-selection
- How to create a JQuery Clock / Timer
- Multiple ajax calls inside a each() function.. then do something once ALL of them are finished?
- pure javascript to check if something has hover (without setting on mouseover/out)
- jQuery iframe file upload
- Toggle visibility property of div
- Javascript change event on input element fires on only losing focus
- Is it possible to add html inside a title attribute?
- jQuery Datepicker: Prevent closing picker when clicking a date
- Trigger standard HTML validation (form) without using submit button? [duplicate]
- Why is element not being shown before alert?
- Implementing jquery UI autocomplete to show suggestions when you type “@”
- Catch scrolling event on overflow:hidden element
- How to delay execution in between the following in my javascript