Files
comp1537-assignment5/public/scripts/client.js
T
2025-03-18 22:46:53 -07:00

17 lines
381 B
JavaScript

function loadCourses() {
const xhttp = new XMLHttpRequest();
xhttp.onload = function() {
document.getElementById("coursesTarget").innerHTML =
this.responseText;
}
xhttp.open("GET", "api/courses");
xhttp.send();
}
async function loaddata() {
let response = await fetch("/api/stuff").then(response => response.json());
console.log(response);
}
loadCourses();