Get started with ipaddr.js CDN
MIT licensed
Ipaddr.js is a lightweight library for IP address validation and manipulation.
Tags:- ip
- ipv4
- ipv6
Stable version
Copied!
How to start using ipaddr.js CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with ipaddr.js CDN - cdnhub.io</title>
<script src="https://cdn.cdnhub.io/ipaddr.js/2.1.0/ipaddr.min.js"></script>
</head>
<body>
<button id="getIp">Get IP Address</button>
<script>
document.getElementById('getIp').addEventListener('click', () => {
navigator.geolocation.getCurrentPosition(position => {
const ipAddress = new IPAddress(position.coords.ipv4);
console.log('IP Address:', ipAddress.toString());
});
});
</script>
</body>
</html>
Copied!
Copied!
Copied!