jsoneditor/examples/02_viewer.html

47 lines
724 B
HTML

<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>Viewer | JSONEditor</title>
<script src="../dist/jsoneditor.js"></script>
<style type="text/css">
body {
font: 11pt arial;
}
#jsoneditor {
width: 500px;
}
</style>
</head>
<body>
<p>
This editor is read-only (mode='view').
</p>
<div id="jsoneditor"></div>
<script>
var container = document.getElementById('jsoneditor')
var options = {
mode: 'view'
}
var editor = jsoneditor(container, options)
var json = {
'array': [1, 2, 3],
'boolean': true,
'null': null,
'number': 123,
'object': {'a': 'b', 'c': 'd'},
'string': 'Hello World'
}
editor.set(json)
</script>
</body>
</html>