基本信息
源码名称:js 获取当前用户的地理位置
源码大小:1.27M
文件格式:.rar
开发语言:js
更新时间:2018-06-11
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link href="css/index.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=liXQzVYi9b7qDIOKPabwIurp"></script>
<script type="text/javascript">
function myFun(result) {
var cityName = result.name;
$("#location").text(cityName);
// $("#location").click(function () {
//
// addCookie('city', cityName, 0);
//
//
// addCookie('province', '未知地区', 0);
//
// });
}
var myCity = new BMap.LocalCity();
myCity.get(myFun);
</script>
</head>
<body>
<div class="popup" id="popup" >
<div class="popup_t">
<p>
请选择您所需要配送的城市</p>
<span>您可能的位置 <a id="location" ></a></span>
</div>
</div>
<div class="overlay" >
</div>
</body>
</html>