Dave's Brain

Browse - Programming Tips - With jQuery how can I convert an object into a query string?

Date: 2017nov14
Library: jQuery
Language: javaScript

Q.  With jQuery how can I convert an object into a query string?

A.  Using jQuery.param(obj) like this:

let obj = { hello: 1, world: 2 }; let qs = $.param(obj); console.log('qs is ' + qs);

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.