<!DOCTYPE html> <html> <body> <h1>将 JavaScript 对象转换为 JSON 字符串,并将其发送到服务器。</h1> <script> const myObj = { name: "Bill", age: 19, city: "Seattle" }; const myJSON = JSON.stringify(myObj); window.location = "/index/demo/form_current.html?x=" + myJSON; </script> </body> </html>