From 2fd2ed966dd2c3ad7526de55b69feac5df3cab69 Mon Sep 17 00:00:00 2001 From: s1n Date: Mon, 30 Sep 2019 21:28:34 -0700 Subject: test if ip detect works --- ip-detection/index.html | 28 ++++++++++++++++++++++++++++ ip-detection/js/main.js | 5 +++++ 2 files changed, 33 insertions(+) create mode 100644 ip-detection/index.html create mode 100644 ip-detection/js/main.js diff --git a/ip-detection/index.html b/ip-detection/index.html new file mode 100644 index 0000000..d21199c --- /dev/null +++ b/ip-detection/index.html @@ -0,0 +1,28 @@ + + + + + + + + s1nical - IP Detection + + + + + + + + + + +

Client side IP geolocation using ipinfo.io

+ +
+
+
+
Full response: +

+    
+
+
\ No newline at end of file
diff --git a/ip-detection/js/main.js b/ip-detection/js/main.js
new file mode 100644
index 0000000..9f6c6ec
--- /dev/null
+++ b/ip-detection/js/main.js
@@ -0,0 +1,5 @@
+$.get("http://ipinfo.io", function (response) {
+    $("#ip").html("IP: " + response.ip);
+    $("#address").html("Location: " + response.city + ", " + response.region);
+    $("#details").html(JSON.stringify(response, null, 4));
+}, "jsonp");
\ No newline at end of file
-- 
cgit v1.2.3