Попытался убрать баг, при котором если после / ввести что-либо, то в img src торчал HTML код
This commit is contained in:
parent
8b5d80e212
commit
bcd81911cd
1 changed files with 1 additions and 1 deletions
|
@ -2,7 +2,7 @@ import axios from "axios";
|
||||||
|
|
||||||
let pictureId = document.getElementById("CatGirlPicture");
|
let pictureId = document.getElementById("CatGirlPicture");
|
||||||
pictureId.onclick = function() {
|
pictureId.onclick = function() {
|
||||||
axios.get(location.href + "rand").then(function (response) {
|
axios.get(location.protocol + "//" + location.host + "/rand").then(function (response) {
|
||||||
console.log(response.data)
|
console.log(response.data)
|
||||||
document.getElementById("CatGirlPicture").setAttribute("src", response.data);
|
document.getElementById("CatGirlPicture").setAttribute("src", response.data);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue