How to get the Public IP address in JavaScript :
<script type=”application/javascript”> function getIP(json) { document.write(“My public IP address is: “, json.ip);}</script>
<script type=”application/javascript” src=”https://api.ipify.org?format=jsonp&callback=getIP”></script>