Search notes:

JavaScript: JSON.stringify

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

  <script type="text/javascript">

    function main() {

      var obj = {};
      obj.foo = 'bar';
      obj.baz = [0, 1, 2, 3];

      var json = JSON.stringify(obj);

      document.getElementById('out').innerHTML = json; // {"foo":"bar","baz":[0,1,2,3]}
      
    }

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

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

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

See also

The JSON object.

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...', 1758207108, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/JavaScript/objects/JSON/stringify(65): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78