shake, with fries

by Zach Carter

jsonip, retrieve the client's IP address via JSONP

This question on Stackoverflow spurred me to write my first Google App Engine project and consequently my first Python script, jsonip. It lets you retrieve a client's IP address without needing your own server-side script. Normally you could make a call to a local server script that prints the user's IP address then use an XMLHttpRequest to retrieve it. jsonip uses JSONP, so you could use it in a situation where you don't have server-side processing available. The usage is simple enough:

Here's the source code for the Python script: (When I say this was my first Python script, I mean it! I had to ask Google how to write if..then statements... )

javascript json | September 22, 2008 at 11:22 AM

Short url: http://zaa.ch/l

blog comments powered by Disqus