W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <body> <h2>把 JavaScript 对象转换为 JSON 字符串,然后发送到服务器。</h2> <script> var myObj = { "name":"Bill Gates", "age":62, "city":"Seattle" }; var myJSON = JSON.stringify(myObj); window.location = "/demo/demo_json.php?x=" + myJSON; </script> </body> </html>