Javascript / jQuery detect IP Address, Country, City, and Timezone

Data return:

  [IP] => 93.154.204.208
    [continentCode] => NA
    [continentName] => North America
    [countryCode2] => US
    [COUNTRY] => US
    [countryCode3] => USA
    [countryName] => United States
    [regionName] => California
    [cityName] => Garden Grove
    [cityLatitude] => 33.7877
    [cityLongitude] => -117.9738
    [countryLatitude] => 38
    [countryLongitude] => -98
    [localTimeZone] => America/Los_Angeles
    [localTime] => 03:33:28 am

Demo: http://www.easyjquery.com/detect-get-clients-ip-address-country-using-javascript-php/

jQuery / Javascript code:

<!-- Require jQuery / Anyversion -->
<script language="Javascript" type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<!-- Require EasyJQuery After JQuery -->
<script language="Javascript" type="text/javascript" src="http://api.easyjquery.com/easyjquery.js"></script>

<script language="Javascript">
    // 1. Your Data Here
    function my_callback(json) {
        alert("IP :" + json.IP + " nCOUNTRY: " + json.COUNTRY);
    }

    function my_callback2(json) {
        // more information at http://api.easyjquery.com/test/demo-ip.php
        alert("IP :" + json.IP + " nCOUNTRY: " + json.COUNTRY + " City: " + json.cityName + " regionName: " + json.regionName);
    }

    // 2. Setup Callback Function
   // EasyjQuery_Get_IP("my_callback"); // fastest version
    EasyjQuery_Get_IP("my_callback2","full"); // full version

</script>

I think this is great code :slight_smile: