18 lines
423 B
JavaScript
18 lines
423 B
JavaScript
window.addEventListener('load', async () => {
|
|
console.log("Seite geladen");
|
|
getNewUniqueLink();
|
|
})
|
|
|
|
async function getNewUniqueLink() {
|
|
try {
|
|
var firstFetch = await fetch('php/generateLink.php');
|
|
var jsonFirstFetch = await firstFetch.json();
|
|
var content = document.getElementById('content');
|
|
content.innerHTML = `${jsonFirstFetch.html}`;
|
|
|
|
} catch (e) {
|
|
console.log("Server nicht erreichbar.");
|
|
}
|
|
|
|
}
|