本文转自:http://www.iteye.com/news/13781
YQL Geo 是一个 JavaScript 库用来根据地名获取经纬度,或者根据经纬度获取对应的地名等……
得到当前地址的IP号:
yqlgeo.get('217.12.14.240',function(o){
alert(o.place.name + ',' + o.place.country.content +
' (' + o.place.centroid.latitude + ',' +
o.place.centroid.longitude + ')'
);
});
查找用户
yqlgeo.get('visitor',function(o){
alert(o.place.name + ',' + o.place.country.content +
' (' + o.place.centroid.latitude + ',' +
o.place.centroid.longitude + ')'
);
});