-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
26 lines (21 loc) · 874 Bytes
/
Copy pathscript.js
File metadata and controls
26 lines (21 loc) · 874 Bytes
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
async function loadChapter(number) {
const response = await fetch(`chapter${number}.json`);
const chapter = await response.json();
document.getElementById("title").textContent = chapter.title;
const container = document.getElementById("verses");
container.innerHTML = "";
chapter.verses.forEach(verse => {
const heb = document.createElement("div");
heb.className = "hebrew";
heb.textContent = verse.hebrewText;
const rus = document.createElement("div");
rus.className = "russian";
rus.textContent = verse.russianText;
const wrapper = document.createElement("div");
wrapper.className = "verse";
wrapper.appendChild(heb);
wrapper.appendChild(rus);
container.appendChild(wrapper);
});
}
document.addEventListener("DOMContentLoaded", () => loadChapter(1));