jsoneditor/examples/02_viewer.html

41 lines
929 B
HTML
Raw Normal View History

2013-01-06 05:19:38 +08:00
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="../jsoneditor.css">
<script type="text/javascript" src="../jsoneditor.js"></script>
<style type="text/css">
body {
font: 11pt arial;
}
2013-01-06 19:58:09 +08:00
#jsoneditor {
width: 500px;
}
2013-01-06 05:19:38 +08:00
</style>
</head>
<body>
<p>
This editor is read-only (mode='viewer').
</p>
2013-01-06 19:58:09 +08:00
<div id="jsoneditor"></div>
2013-01-06 05:19:38 +08:00
<script type="text/javascript" >
2013-08-28 04:50:20 +08:00
var container = document.getElementById('jsoneditor');
2013-01-06 05:19:38 +08:00
var options = {
2013-08-28 04:50:20 +08:00
mode: 'view'
2013-01-06 05:19:38 +08:00
};
2013-08-28 04:50:20 +08:00
2013-01-06 05:19:38 +08:00
var json = {
2013-08-28 04:50:20 +08:00
'array': [1, 2, 3],
'boolean': true,
'null': null,
'number': 123,
'object': {'a': 'b', 'c': 'd'},
'string': 'Hello World'
2013-01-06 05:19:38 +08:00
};
2013-08-28 04:50:20 +08:00
2013-01-06 19:58:09 +08:00
var editor = new jsoneditor.JSONEditor(container, options, json);
2013-01-06 05:19:38 +08:00
</script>
</body>
</html>