How to Get Client Ip Address Using JavaScript
In this tutorial, We will explain to you how to get client ip address using javascript. sometimes which users are coming requests, That’s where it comes from. Let’s use the following example to track it.
In this example, we get data using the getJSON method. so let’s see the below example of javascript get ip address.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>How to Get Client Ip Address Using JavaScript - XpertPhp</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script> var ipinfo; $.getJSON("https://ipinfo.io", function (data) { console.log(data); }) </script> </head> <body> </body> </html> |
Please follow and like us: