style: add indentation to js code

This commit is contained in:
Cotes Chung 2024-12-03 22:22:20 +08:00
parent a16aa7d41e
commit 4180992272
No known key found for this signature in database
GPG key ID: 0D9E54843167A808

View file

@ -8,14 +8,14 @@
const url = `https://{{ site.analytics.goatcounter.id }}.goatcounter.com/counter/${encodeURIComponent(uri)}.json`;
fetch(url)
.then((response) => response.json())
.then((data) => {
const count = data.count.replace(/\s/g, '');
pv.innerText = new Intl.NumberFormat().format(count);
})
.catch((error) => {
pv.innerText = '1';
});
.then((response) => response.json())
.then((data) => {
const count = data.count.replace(/\s/g, '');
pv.innerText = new Intl.NumberFormat().format(count);
})
.catch((error) => {
pv.innerText = '1';
});
}
});
</script>