Geolocation API
How do I make an geolocation api?
Quick geoloaction demo using the ipinfo.io API & jQuery.. What is a geolocation api? How do you make a geolocation api? This script and codes were developed by Jeff Pannone on 12 August 2022, Friday.
Geolocation API - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Geolocation API</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <p>Geolocation API with ipinfo.io</p>
<ul> <li class="ip"><span>IP:</span></li> <li class="country"><span>Country:</span></li> <li class="region"><span>Region:</span></li> <li class="city"><span>City:</span></li>
</ul> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Geolocation API - Script Codes CSS Codes
body{font-family:helvetica, arial, sans-serif}
p{ font-weight:bold; font-size:1.15em;
}
ul{ padding:0 margin:0 0 0 .25em;
}
ul li{ list-style:none;
}
ul li span:first-child{ width:7em; display:inline-block;
}
Geolocation API - Script Codes JS Codes
$.get("http://ipinfo.io", function(response) { var ip = response.ip; var country = response.country; var region = response.region; var city = response.city;
/* console.log(ip); console.log(country); console.log(region); console.log(city);*/ $('.ip').append('<span>' + ip + '<\/span>'); $('.country').append('<span>' + country + '<\/span>'); $('.region').append('<span>' + region + '<\/span>'); $('.city').append('<span>' + city + '<\/span>');
}, "jsonp");
Developer | Jeff Pannone |
Username | jeffpannone |
Uploaded | August 12, 2022 |
Rating | 3 |
Size | 1,952 Kb |
Views | 22,264 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Photoswipe Drug Facts | 5,320 Kb |
JQuery Division | 1,970 Kb |
Slick dropdown navigation | 5,966 Kb |
Magnific - open popup with URL param | 3,607 Kb |
JQuery Viewport Size | 2,317 Kb |
Slide Toggle for Adam | 2,764 Kb |
HTML2Canvas Preview | 24,347 Kb |
DWSG Templates | 11,029 Kb |
A Pen by Jeff Pannone | 1,716 Kb |
Hompage Grid | 5,086 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
LAMP PURE CSS with Animation | Dam62500 | 2,911 Kb |
Wave Lines | Mikehobizal | 4,023 Kb |
Cartoon Bomb | Tcmulder | 4,929 Kb |
Project MMetro beta | Atomicsong | 5,157 Kb |
CSS3 Diamond | Rendro | 1,960 Kb |
Countdown Timer | Massiebn | 3,001 Kb |
Polygon Logo in CSS | Kai | 3,412 Kb |
Perspective Origin Demo | Agelber | 3,614 Kb |
A Pen by Moeid Saleem | Moeidsaleem | 1,862 Kb |
Flying Bee | Pwsm50 | 3,711 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!