代码拉取完成,页面将自动刷新
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>默认浏览器客户端IP定位查询当前用户所在城市</title>
<script type="text/javascript" src="http://pv.sohu.com/cityjson" charset="utf-8"></script>
<script charset="utf-8" src="http://map.qq.com/api/js?v=2.exp"></script>
<script>
var citylocation=null;
var init = function() {
//获取 城市位置信息查询 接口
citylocation = new qq.maps.CityService({
complete : function(results){
alert(results.detail.name);
}
});
}
function geolocation_ip() {
var localIp = returnCitySN["cip"];
alert(localIp);
init();
//调用查询ip接口查询信息
citylocation.searchCityByIP(localIp);
}
geolocation_ip();
</script>
</head>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。