我希望创建一个基本的IP跟踪器,我试图弄清楚如何回应这个变量的某些方面,欢呼:
</template>
<script>
TodoPopup = Polymer({
is : 'todo-popup' ,
behaviors : [Polymer.IronOverlayBehavior]
});
</script>
这是我正在阅读的代码:
{"ip":"MY IP","country_code":"GB","country_name":"United Kingdom","region_code":"ENG","region_name":"England","city":"MY CITY","zip_code":"MY CODE","time_zone":"Europe/London","latitude":----,"longitude":-----,"metro_code":-}
}
干杯!
答案 0 :(得分:3)
回应一些事情
//Example
$locationObject = json_decode($location);
echo $locationObject->ip;
//Prints out: 77.99.179.98
更多信息 http://www.dyn-web.com/tutorials/php-js/json/decode.php