mirror of
https://github.com/zyllian/webdog.git
synced 2025-05-10 02:26:42 -07:00
update count immediately
This commit is contained in:
parent
c03df4e661
commit
f5f19b5b56
1 changed files with 1 additions and 0 deletions
|
@ -17,6 +17,7 @@
|
||||||
petButton.addEventListener("click", async () => {
|
petButton.addEventListener("click", async () => {
|
||||||
petButton.disabled = true;
|
petButton.disabled = true;
|
||||||
petButton.outerHTML = "| thanks! <3";
|
petButton.outerHTML = "| thanks! <3";
|
||||||
|
count.innerText = Number.parseInt(count.innerText) + 1;
|
||||||
const r = await (await fetch(url, { method: "post" })).json();
|
const r = await (await fetch(url, { method: "post" })).json();
|
||||||
if (r.count) {
|
if (r.count) {
|
||||||
count.innerText = r.count;
|
count.innerText = r.count;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue