<script>
var _script = document.createElement('script');
_script.type = "text/javascript";
_key = "55UbnVOR7XovezZC4jFvTqNDPAamsuoo";//百度地图可以申请到
_script.src = "
http://api.map.baidu.com/location/ip?ak="+_key+"&coor=bd09ll&ip=&callback=f";//拼接URL
document.head.appendChild(_script);
var pointX;
var pointY;
function f(data){
pointX = data.content.point.x;
pointY = data.content.point.y;
document.getElementById("comefrom").innerHTML = "你所在城市:"+data.content.address;
// document.getElementById("pointX").innerHTML = "你城市经度:"+pointX;
// document.getElementById("pointY").innerHTML = "你的城市纬度:"+pointY;
}
</script>