-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathexample.html
More file actions
31 lines (27 loc) · 1.08 KB
/
example.html
File metadata and controls
31 lines (27 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<html>
<head>
<title>json.worker.js Example</title>
</head>
<body bgcolor="#000000" class="nomargin body" style="overflow: hidden;">
<script type="text/javascript" src="json.async.js"></script>
<script>
function parseJsonButtonPressed()
{
var startTime = new Date().getTime();
var jsonString = document.getElementById( "jsonArea" ).value;
JSON.parseAsync( jsonString, function(json)
{
var currentTime = new Date().getTime();
var time = currentTime - startTime;
alert( "Parsing this json took: " + time + "ms\n" + json );
});
}
</script>
<table class="nomargin" width="100%" height="100%">
<tbody><tr><td valign="middle">
<textarea id="jsonArea" rows="50" cols="50">{ "data": "Replace this json with a bigger file" }</textarea>
<button type="button" onclick="parseJsonButtonPressed()">Parse JSON</button>
</td></tr></tbody>
</table>
</body>
</html>