const myObj = {name: "John", age: 31, city: "New York"}; const myJSON = JSON.stringify(myObj); window.location = "demo_json.php?x=" + myJSON;