You're looking for the jQuery.param
function.
How to serialise a javascript object [duplicate]
-
23-09-2022 - |
Question
When you serialise a form using jQuery.serialize(), the method will serialise the form fields and its values so you can submit to the server. Is there a method/function that would do the same with a javascript object instead of a form?
La solution 2
Autres conseils
Check out JSON.stringify
.
JSON.stringify({x: 5, y: 6}); // '{"x":5,"y":6}' or '{"y":6,"x":5}'
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow