0

古老的问题。需要找到解决方案。

这个:

$.getJSON("http://jsonip.appspot.com?callback=?", function(data){ip=data.ip});

似乎不再起作用:

App Engine Error

Over Quota

This Google App Engine application is temporarily over its serving quota. 
Please try again later.

我找到了这个http://checkip.dyndns.org/

我使用加载(数据类型设置为 jsonp)来尝试获取 html,但我认为我做的不对或者无法完成。

有什么帮助吗?

谢谢一堆;-)

4

2 回答 2

5

只需使用以下代码创建一个 php 文件:

echo ' [ { "ip" : "$_SERVER['REMOTE_ADDR']" } ]';

然后用get JSON ping它

于 2011-06-22T03:18:46.710 回答
1
<!-- Require jQuery / Anyversion --><script type="text/javascript" language="Javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<!-- Require EasyJQuery After JQuery --><script type="text/javascript" language="Javascript" src="http://api.easyjquery.com/easyjquery.js"></script>
<script type="text/javascript" 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>



[IP] => 93.154.204.205
    [ContinentCode] => NA
    [ContinentName] => North America
    [CountryCode2] => US
    [CountryCode3] => USA
    [COUNTRY] => US
    [CountryName] => United States
    [RegionName] => California
    [CityName] => Garden Grove
    [CityLatitude] => 33.7831
    [CityLongitude] => -118.0271
    [CountryLatitude] => 38
    [CountryLongitude] => -98
    [LocalTimeZone] => America/Los_Angeles
    [REMOTE_ADDR] => 77.93.210.64
    [HTTP_X_FORWARDED_FOR] => 
    [CallingCode] => 1
    [Population] => 307,212,123 (3)
    [AreaSqKm] => 9,826,675 (4)
    [GDP_USD] => 14.26 Trillion (1)
    [Capital] => Washington, D.C.
    [Electrical] => 120 V,60 Hz Type A Type B
    [Languages] => English 82.1%, Spanish 10.7%, other Indo-European 3.8%, Asian and Pacific island 2.7%, other 0.7% (2000 census)
    [Currency] => US Dollar (USD)
    [Flag] => http://api.easyjquery.com/proips/flags/US.jpg
于 2012-11-27T02:53:21.610 回答