Here’s a non-jQuery version:
function toQueryString(obj) {
var parts = [];
for (var i in obj) {
if (obj.hasOwnProperty(i)) {
parts.push(encodeURIComponent(i) + "=" + encodeURIComponent(obj[i]));
}
}
return parts.join("&");
}
More Related Contents:
- Converting JavaScript object with numeric keys into array
- Array Like Objects in Javascript
- How to flatten array in jQuery?
- Each for object? [duplicate]
- Enable & Disable a Div and its elements in Javascript [duplicate]
- Force hide address bar in Chrome on Android
- Is there an “after submit” jQuery option?
- Is there a better jQuery solution to this.form.submit();?
- Alternative to eval() javascript [duplicate]
- How to keep elements non-refreshed
- jQuery JSONP ajax, authentication header not being set
- Downloading file from ajax result using blob
- How do you swap DIVs on mouseover (jQuery)?
- $.post throwing “Illegal invocation “
- how to update time regularly?
- jQuery selector to target any class name (of multiple present) starting with a prefix?
- Google’s Places API and JQuery request – Origin http://localhost is not allowed by Access-Control-Allow-Origin
- What’s the difference between a jQuery object and a DOM element? Difference between .get() and .index()?
- Change background on button click, using CSS only? [duplicate]
- Javascript reflection: Get nested objects path
- XMLHttpRequest; Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource [duplicate]
- How is AngularJS different from jQuery
- Error: Permission denied to access property ‘handler’
- Looking for a better workaround to Chrome select on focus bug
- jQuery SVG vs. Raphael [closed]
- How do I detect IE 8 with jQuery?
- jquery: $(window).scrollTop() but no $(window).scrollBottom()
- In web browsers, what’s the difference between onblur and onfocusout?
- moment.js isValid function not working properly
- Create a table in SVG