//jsonp
function handleResponse(response){
console.log('IP address',response);
console.log("You're at IP address " + response.ip + ',which is in '+ response.city+', '+ response.region_name);
}
var script = document.createElement('script');
script.src = 'http://freegeoip.net/json/?callback=handleResponse';
document.body.insertBefore(script,document.body.firstChild);
console
网友评论