SHOW:
|
|
- or go back to the newest paste.
1 | - | <div id="yourinfo"></div> |
1 | + | <div id="yourinfo"></div> |
2 | - | <script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAp04yNttlQq-7b4aZI_jL5hQYPm-xtd00hTQOC0OXpAMO40FHAxQMnH50uBbWoKVHwgpklyirDEregg"></script> |
2 | + | <script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAp04yNttlQq-7b4aZI_jL5hQYPm-xtd00hTQOC0OXpAMO40FHAxQMnH50uBbWoKVHwgpklyirDEregg"></script> |
3 | - | <script type="text/javascript"> |
3 | + | <script type="text/javascript"> |
4 | - | if(google.loader.ClientLocation) |
4 | + | if(google.loader.ClientLocation) |
5 | - | { |
5 | + | { |
6 | - | visitor_lat = google.loader.ClientLocation.latitude; |
6 | + | visitor_lat = google.loader.ClientLocation.latitude; |
7 | - | visitor_lon = google.loader.ClientLocation.longitude; |
7 | + | visitor_lon = google.loader.ClientLocation.longitude; |
8 | - | visitor_city = google.loader.ClientLocation.address.city; |
8 | + | visitor_city = google.loader.ClientLocation.address.city; |
9 | - | visitor_region = google.loader.ClientLocation.address.region; |
9 | + | visitor_region = google.loader.ClientLocation.address.region; |
10 | - | visitor_country = google.loader.ClientLocation.address.country; |
10 | + | visitor_country = google.loader.ClientLocation.address.country; |
11 | - | visitor_countrycode = google.loader.ClientLocation.address.country_code; |
11 | + | visitor_countrycode = google.loader.ClientLocation.address.country_code; |
12 | - | document.getElementById('yourinfo').innerHTML = '<p>Lat/Lon: ' + visitor_lat + ' / ' + visitor_lon + '</p><p>Location: ' + visitor_city + ', ' + visitor_region + ', ' + visitor_country + ' (' + visitor_countrycode + ')</p>'; |
12 | + | document.getElementById('yourinfo').innerHTML = '<p>Lat/Lon: ' + visitor_lat + ' / ' + visitor_lon + '</p><p>Location: ' + visitor_city + ', ' + visitor_region + ', ' + visitor_country + ' (' + visitor_countrycode + ')</p>'; |
13 | - | } |
13 | + | } |
14 | - | else |
14 | + | else |
15 | - | { |
15 | + | { |
16 | - | document.getElementById('yourinfo').innerHTML = '<p>Whoops!</p>'; |
16 | + | document.getElementById('yourinfo').innerHTML = '<p>Whoops!</p>'; |
17 | - | } |
17 | + | } |
18 | </script> | |
19 | ||
20 | http://services.ipaddresslabs.com/iplocation/locateip?key=SAK58RWP983694534K4Z&ip=".$ClientIP |