wx.config注入不上,没有提示,没有反应,公众号白名单和安全域名都设置了
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>
wx.config({
debug: ture,
appId: '<?php echo $signPackage["appId"];?>',
timestamp: <?php echo $signPackage["timestamp"];?>,
nonceStr: '<?php echo $signPackage["nonceStr"];?>',
signature: '<?php echo $signPackage["signature"];?>',
jsApiList: [
"getLocation",
"closeWindow",
]
});
wx.ready(function () {
wx.getLocation({
type: 'wgs84', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
isHighAccuracy:true,
highAccuracyExpireTime:10000,
success: function (res) {
var latitude = res.latitude; // 纬度,浮点数,范围为90 ~ -90
var longitude = res.longitude; // 经度,浮点数,范围为180 ~ -180。
var speed = res.speed; // 速度,以米/每秒计
var accuracy = res.accuracy; // 位置精度
var url="./pc_send.php?uid=<?=$id?>&latitude="+latitude+"&longitude="+longitude+"&departmenttree=<?=$departmenttree?>&accessToken=<?=$jssdk->getAccessToken()?>&openid=<?=$openid?>";
window.location=url;
}
});
});
debug: ture,
ture打错了,是true 问题解决