Use the Fetch API instead of PrototypeJS
This commit is contained in:
parent
c622ada0df
commit
0876fc3c2e
2 changed files with 8 additions and 4 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue