Search notes:

JavaScript Object: JSON

JSON.stringify(obj) creates a JSON string from a JavaScript object or variable.

parse

<!DOCTYPE HTML>
<html>
<head>
  <title>Javasctipt JSON.parse()</title>
  <meta content="text/html;charset=utf-8" http-equiv="Content-Type">

  <script type="text/javascript">

    function main() {

      var obj = JSON.parse('{"foo": "bar", "baz": [0, 1, 2, 3]}');

      out.innerHTML += "foo: "    + obj.foo    + "<br>";
      out.innerHTML += "baz[1]: " + obj.baz[1] + "<br>";
    }

  </script>
</head>
<body onload="main();">

  <div id="out"></div>

</body>
</html>
Github repository about-javascript, path: /objects/JSON/parse.html

See also

objects

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759561889, '216.73.216.149', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/JavaScript/objects/JSON/index(66): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78