rough implementations of Moment and Essay creation and viewing completed.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
let essays = document.querySelectorAll(".divLink");
|
||||
|
||||
essays.forEach((e) => {
|
||||
let link = e.querySelector("a").href;
|
||||
let id = link.split("=")[2];
|
||||
|
||||
e.addEventListener("click", () => {
|
||||
fetch("director.php", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
},
|
||||
body: "ajaxId=viewEssay&id=" + id,
|
||||
})
|
||||
.then((response) => {
|
||||
return response.json();
|
||||
})
|
||||
.then((data) => {
|
||||
if (!data["html"]) return;
|
||||
|
||||
openModal(data["html"]);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user