【发布时间】:2015-10-30 00:17:41
【问题描述】:
我正在使用 jQuery 通过 API 获取 JSON 数据。现在我无法在我的 PHP 代码中获取 JSON 数据
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script type="application/javascript">
$(document).ready(function() {
$.getJSON("http://www.telize.com/geoip?callback=?",
function(json) {
document.write("Geolocation information for IP address : ", json.ip);
document.write("Country : ", json.country);
document.write("Latitude : ", json.latitude);
document.write("Longitude : ", json.longitude);
}
);
});
</script>
//result is below on browser
//Geolocation information for IP address : 45.114.126.32Country : PakistanLatitude : 30Longitude : 70
现在我想在我的 PHP 代码中获取纬度和经度值。如何解析这段代码?
【问题讨论】: