46 lines
699 B
HTML
46 lines
699 B
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<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>
|