Use the Fetch API instead of PrototypeJS

This commit is contained in:
nemunaire 2019-09-01 17:13:03 +02:00
commit 0876fc3c2e
2 changed files with 8 additions and 4 deletions

View file

@ -50,6 +50,11 @@ function show_picture(id) {
return;
}
if (picts.length == 0) {
document.body.innerHTML = '<h1>Welcome on YouP0m!</h1><h2>There is no image currently, come back soon!</h2>';
return
}
if (id == null || id == "")
id = picts[Math.floor(Math.random() * picts.length)].name;
@ -112,7 +117,7 @@ function display_picture(pict, next) {
}
function display_error(msg) {
$$("body")[0].innerHTML = '<h1>An error occurs</h1><h2>' + msg + '</h2>';
document.body.innerHTML = '<h1>An error occurs</h1><h2>' + msg + '</h2>';
}
function sync() {