source: other-projects/FileTransfer-WebSocketPair/Themes/themebuilder/bin/phantomjs-1.9.2-macosx/examples/ipgeocode.coffee@ 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: 392 bytes
Line 
1# Give the estimated location based on the IP address.
2
3window.cb = (data) ->
4 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
11el = document.createElement 'script'
12el.src = 'http://freegeoip.net/json/?callback=window.cb'
13document.body.appendChild el
Note: See TracBrowser for help on using the repository browser.