jsoneditor/examples/02_viewer.html

47 lines
807 B
HTML
Raw Permalink Normal View History

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