fixed bug in js stuff
This commit is contained in:
parent
9b2e68ae0a
commit
f79bc57d83
@ -1,4 +1,5 @@
|
||||
function main() {
|
||||
let ip = "";
|
||||
let dip_ip = document.getElementById("dip_ip");
|
||||
let dip_hostname = document.getElementById("dip_hostname");
|
||||
let dip_city = document.getElementById("dip_city");
|
||||
@ -6,6 +7,10 @@ function main() {
|
||||
let dip_as_number = document.getElementById("dip_as_number");
|
||||
let dip_as_org = document.getElementById("dip_as_org");
|
||||
|
||||
if (window.location.pathname.length > 4) {
|
||||
ip = window.location.pathname.split("/")[1];
|
||||
}
|
||||
|
||||
fetch(`/json/${ip}`).then((response) => {
|
||||
response.json().then((res) => {
|
||||
dip_ip.innerHTML = res["ip"];
|
||||
|
Loading…
Reference in New Issue
Block a user