cse110-fa22-group29/source/assets/scripts/ReviewPage.js

14 lines
354 B
JavaScript
Raw Normal View History

2022-11-12 18:10:07 +00:00
// Run the init() function when the page has loaded
window.addEventListener("DOMContentLoaded", init);
2022-11-12 18:10:07 +00:00
function init() {
let result = sessionStorage.getItem("currReview");
2022-11-12 18:10:07 +00:00
let main = document.querySelector("main");
2022-11-12 18:10:07 +00:00
main.innerHTML = result;
let p = document.createElement("p");
p.innerHTML = JSON.parse(result)["comments"];
main.append(p);
2022-11-12 18:10:07 +00:00
}