this.loadTemplate = async(currentPage) => {
let promise = new Promise((resolve) => {
$(() => $("#nav").load("./nav.html"));
$(() => $("#footer").load("./footer.html"));
resolve("resolved");
});
let result = await promise;
console.log(result);
$(`#${currentPage}`).addClass("current-page");
};
Above is the code for loading and adding the class to the nav.html file. Which should change an element to orange. Which it doesn't.
Any help is appreciated.