source: other-projects/FileTransfer-WebSocketPair/Themes/themebuilder/bin/phantomjs-1.9.2-macosx/examples/ipgeocode.js@ 31525

Last change on this file since 31525 was 31525, checked in by ak19, 7 years ago

Nathan provided more stuff: Themes folder contains Sencha's Themebuilder which generates GXT Themes. It includes the .theme and generated .jar files for the project theme.

File size: 426 bytes
Line 
1// Give the estimated location based on the IP address.
2
3cb = function (data) {
4 var loc = data.city;
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);
9 phantom.exit();
10};
11
12var el = document.createElement('script');
13el.src = 'http://freegeoip.net/json/?callback=cb';
14document.body.appendChild(el);
Note: See TracBrowser for help on using the repository browser.