-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
28 lines (24 loc) · 808 Bytes
/
script.js
File metadata and controls
28 lines (24 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$(document).ready(function(){
$("#iplookupbtn").click(function(){
var user_ip = $("#ipadd").val();
if(user_ip == ''){
alert('Please Enter IP Address');
}
else{
$.getJSON('https://ipinfo.io/'+user_ip+'/json', function(data){
var ip = data.ip;
var address = data.city+', '+data.region+', '+data.country;
var network = data.org;
var postal = data.postal;
var timezone = data.timezone;
var loc = data.loc;
$("#ipaddress").html(ip);
$("#address").html(address);
$("#network").html(network);
$("#pincode").html(postal);
$("#timezone").html(timezone);
$("#loc").html(loc);
});
}
});
});