Advertisement
amoussa11

JavaScript JSON Reference

Feb 17th, 2019
441
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. <h2>Convert a JavaScript object into a JSON string,  send it to the server.</h2>
  3.  
  4. <script>
  5. var myObj = { "name":"John", "age":31, "city":"New York" };
  6. var myJSON = JSON.stringify(myObj);
  7. window.location = "demo_json.php?x=" + myJSON;
  8. </script>
  9.  
  10. </body>
  11. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement