17 lines
381 B
JavaScript
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(); |