I wish to point out that if you use http://freegeoip.net/, you don't need to supply to it the IP address of the client's location. Just try these:
1) http://freegeoip.net/xml/
2) http://freegeoip.net/json/
3) http://freegeoip.net/csv/
However, I am unable to retrieve the information with AJAX calls, probably because of some cross-origin policy. Apparently they have not allowed public access to their system.