Добавил возможность смены картинки при нажатии на картинку
This commit is contained in:
parent
9dbcc53fd1
commit
0d782ec32e
5 changed files with 1051 additions and 8 deletions
|
|
@ -1,7 +1,9 @@
|
|||
import axios from "axios";
|
||||
|
||||
let pictureId = document.getElementById("CatGirlPicture")
|
||||
let pictureId = document.getElementById("CatGirlPicture");
|
||||
pictureId.onclick = function() {
|
||||
let picFilename = axios.get(location.href + "rand")
|
||||
console.log(picFilename)
|
||||
axios.get(location.href + "rand").then(function (response) {
|
||||
console.log(response.data)
|
||||
document.getElementById("CatGirlPicture").setAttribute("src", "images/"+response.data);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue