We can convert the object into JSON, and send the data to a server as a value of
x
variable (but it's not ideal way of sending JSON to a server)
var myObj = {name: "John", age: 31, city: "New York"};
var myJSON = JSON.stringify(myObj);
window.location = "demo_json.php?x=" + myJSON;
by Valeri Tandilashvili
4 years ago
JSON
JavaScript
JS JSON
1
Pro tip: use ```triple backticks around text``` to write in code fences