-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathindex.html
36 lines (32 loc) · 1.01 KB
/
index.html
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
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<link href="https://cdnjs.cloudflare.com/ajax/libs/jsoneditor/9.10.2/jsoneditor.css" rel="stylesheet" type="text/css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jsoneditor/9.10.2/jsoneditor.min.js"></script>
</head>
<body>
<div style="display: flex; justify-content: center;">
<div id="jsoneditor" style="width: 800px; height: 800px;"></div>
</div>
<script>
// create the editor
var container = document.getElementById("jsoneditor");
var editor = new JSONEditor(container);
// set json
async function setJSON () {
const response = await fetch('http://localhost:8000/resumes');
const data = await response.json()
editor.set(data);
}
// get json
function getJSON() {
var json = editor.get();
alert(JSON.stringify(json, null, 2));
}
document.addEventListener('DOMContentLoaded', function(event) {
setJSON()
});
</script>
</body>
</html>