Update index.html
Browse files- index.html +19 -1
index.html
CHANGED
@@ -35,7 +35,25 @@
|
|
35 |
</div>
|
36 |
|
37 |
<script>
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
function updateDisplay() {
|
41 |
const selector = document.getElementById('jsonSelector');
|
|
|
35 |
</div>
|
36 |
|
37 |
<script>
|
38 |
+
let jsonObjects;
|
39 |
+
|
40 |
+
async function fetchData() {
|
41 |
+
const response = await fetch('characters.output.manually'); // Replace 'your_data_file.txt' with the actual file path
|
42 |
+
const data = await response.text();
|
43 |
+
jsonObjects = data.split('\n').filter(Boolean).map(JSON.parse);
|
44 |
+
}
|
45 |
+
|
46 |
+
function populateDropdown() {
|
47 |
+
const selector = document.getElementById('jsonSelector');
|
48 |
+
|
49 |
+
jsonObjects.forEach((_, index) => {
|
50 |
+
const option = document.createElement('option');
|
51 |
+
option.value = index;
|
52 |
+
option.text = `Object ${index + 1}`;
|
53 |
+
selector.add(option);
|
54 |
+
});
|
55 |
+
}
|
56 |
+
|
57 |
|
58 |
function updateDisplay() {
|
59 |
const selector = document.getElementById('jsonSelector');
|