-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.html
More file actions
52 lines (51 loc) · 1.4 KB
/
example.html
File metadata and controls
52 lines (51 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="" rel="stylesheet">
<script type="text/javascript" src="json-editor.js"></script>
<script type="text/javascript" src="inherit-element.js"></script>
<script type="text/javascript">
<!--
window.onload = function () {
var editor = new jsonEditor(
"jsonEditorBox",
{
'str': 'hello world!',
'number':1,
'boolean': true,
'list': [1, 2],
'empty': [],
'object': {
'key1': null,
'key2': false,
'key3': ['xxx', 'yyy'],
'key4': function (){}
}
},
{
hotKey: 'J',
width: 680,
// height: 480
}
);
document.getElementById('exportValue').onclick = function () {
console.log(editor.value());
};
document.getElementById('exportText').onclick = function () {
console.log(editor.text());
};
//console.log(document.getElementById('jsonEditorBox').querySelector(':scope > UL'))
};
-->
</script>
<title>contentEditable - plaintext-only</title>
</head>
<body>
<div id="jsonEditorBox"></div>
<div style="margin-top:8px;">
<input id="exportValue" type="button" value="exportValue" style="width:100px;height:28px;"/>
<input id="exportText" type="button" value="exportText" style="width:100px;height:28px;"/>
</div>
</body>
</html>