2013-01-06 05:19:38 +08:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<head>
|
2016-11-12 03:26:32 +08:00
|
|
|
<meta charset="UTF-8">
|
2016-10-28 15:36:05 +08:00
|
|
|
<title>Viewer | JSONEditor</title>
|
2015-02-28 04:54:04 +08:00
|
|
|
|
2015-03-01 03:47:23 +08:00
|
|
|
<script src="../dist/jsoneditor.js"></script>
|
|
|
|
|
2015-02-28 04:54:04 +08:00
|
|
|
|
2013-11-16 01:11:50 +08:00
|
|
|
<style type="text/css">
|
|
|
|
body {
|
|
|
|
font: 11pt arial;
|
|
|
|
}
|
|
|
|
#jsoneditor {
|
|
|
|
width: 500px;
|
|
|
|
}
|
|
|
|
</style>
|
2013-01-06 05:19:38 +08:00
|
|
|
</head>
|
|
|
|
<body>
|
2013-11-16 01:11:50 +08:00
|
|
|
<p>
|
2016-10-14 23:30:16 +08:00
|
|
|
This editor is read-only (mode='view').
|
2013-11-16 01:11:50 +08:00
|
|
|
</p>
|
|
|
|
<div id="jsoneditor"></div>
|
2013-01-06 05:19:38 +08:00
|
|
|
|
2015-02-28 04:54:04 +08:00
|
|
|
<script>
|
2016-10-14 23:30:16 +08:00
|
|
|
var container = document.getElementById('jsoneditor')
|
2013-08-28 04:50:20 +08:00
|
|
|
|
2013-11-16 01:11:50 +08:00
|
|
|
var options = {
|
|
|
|
mode: 'view'
|
2016-10-14 23:30:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
var editor = jsoneditor(container, options)
|
2013-08-28 04:50:20 +08:00
|
|
|
|
2013-11-16 01:11:50 +08:00
|
|
|
var json = {
|
|
|
|
'array': [1, 2, 3],
|
|
|
|
'boolean': true,
|
|
|
|
'null': null,
|
|
|
|
'number': 123,
|
|
|
|
'object': {'a': 'b', 'c': 'd'},
|
|
|
|
'string': 'Hello World'
|
2016-10-14 23:30:16 +08:00
|
|
|
}
|
|
|
|
editor.set(json)
|
2013-08-28 04:50:20 +08:00
|
|
|
|
2013-11-16 01:11:50 +08:00
|
|
|
</script>
|
2013-01-06 05:19:38 +08:00
|
|
|
</body>
|
|
|
|
</html>
|