3 ms·
http://jsonip.com - Get a visitor's IP with js
I wrote a node.js app today that lets you get a client's IP address as either a json object, or with with a jsonp callback.
json example, http://jsonip.com
{'ip':'<client ip>'}
jsonp example:
cb({'ip':'<client ip>'});
<script type="text/javascript">
cb = function(obj){
console.log(obj);
}
</script>
<script type="text/javascript" src="http://jsonip.com/cb"></script>
- robinduckett 16y agoSomeone beat you to it: http://jsonip.appspot.com/ http://jsonip.appspot.com/ http://stackoverflow.com/questions/391979/get-client-ip-using-just-javascript http://stackoverflow.com/questions/391979/get-client-ip-usin... http://stackoverflow.com/questions/102605/can-i-lookup-the-ip-address-of-a-hostname-from-javascript http://stackoverflow.com/questions/102605/can-i-lookup-the-i... (2 years ago) Quick googling returned this, unless you are Zach?