Convert array to JSON : JSON « Dojo toolkit « JavaScript DHTML






Convert array to JSON

 

<html>
  <head>
    <link rel="StyleSheet" type="text/css"
      href="js/dojo/dijit/themes/tundra/tundra.css">
    <script type="text/javascript">
      var djConfig = {
        baseScriptUri : "js/dojo/",
        parseOnLoad : true
      };
    </script>
    <script type="text/javascript" src="js/dojo/dojo/dojo.js"></script>
    <script>
    function Foo(  ) {
        var o = {a:1, b:2, c:3, d:4};
        alert( dojo.toJson(o, true));

    }


    </script>
  </head>
  <body class="tundra" onload=Foo()>


</body>
</html>

   
  








Dojo-toolkit.zip( 3,849 k)

Related examples in the same category

1.Convert object to JSON
2.Convert query string to JSON