1 // Give the estimated location based on the IP address.
5 if (data.region_name.length > 0)
6 loc = loc + ', ' + data.region_name;
7 console.log('IP address: ' + data.ip);
8 console.log('Estimated location: ' + loc);
12 var el = document.createElement('script');
13 el.src = 'http://freegeoip.net/json/?callback=cb';
14 document.body.appendChild(el);