Welcome aboard! We are happy you are here and wish you good net-raft!
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<script src="/vanilla.js"></script>
</head>
<body>
<script type="text/javascript">
var request = new XMLHttpRequest();
request.open('GET', 'https://geoip-db.com/json/', true);
request.onload = function() {
if (request.status >= 200 && request.status < 400) {
var data = JSON.parse(request.responseText);
alert("Success: " + data.country_name + "-" + data.city + "-" + data.IPv4);
} else {
}
};
request.onerror = function() {
// something do ...
};
request.send();
</script>
</body>
</html>
The most helpful JAVASCRIPT solutions
How can I get the last day and the next day in javascript ?JAVASCRIPT Click to see more ... 5.8K 507