Also apply the __toString fix to UserInfo
[cacert-mgr.git] / external / ZendFramework-1.9.5 / externals / dojo / demos / i18n / normalizeJson.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
3 <html>
4 <head>
5 <title>Normalize JSON</title>
6 <script type="text/javascript" src="../../dojo/dojo.js" charset="utf-8" djConfig="isDebug: true"></script>
7 <script>
8 function process(){
9 console.log("point 1");
10 url = dojo.byId("url").value;
11 d2 = dojo.xhrGet({url: url, handleAs: "json-comment-optional"});
12 console.log("did get on " + url);
13 d2.addCallback(null, function(data){
14 dojo.byId("output").value = dojo.toJson(data, true);
15 });
16 d2.addErrback(null, function(err){
17 alert(err);
18 });
19 }
20 </script>
21 </head>
22 <body class="tundra">
23 <p>
24 Enter a URL to a JSON file and then press normalize, and it will read in the data and then
25 print it with trailing commas removed, etc.
26 </p>
27 URL: <input id=url value="languages.json"> <button onclick="console.log(process); process(); console.log('done');">normalize</button>
28 <br>
29 <textarea id=output style="width: 90%; height: 500px;"></textarea>
30 </body>
31 </html>