24

I need to show IP address in page footer in static site is it possible to get IP address using JavaScript or jQuery...

I tried this but it is giving same value in all computers

<script>
var myip;
function ip_callback(o) {
    myip = o.host;
}
</script>
<script src="https://smart-ip.net/geoip-json?callback=ip_callback"></script>
<script>alert(myip);</script>
Kinjan Koradiya
  • 449
  • 1
  • 4
  • 17

0 Answers0