就比如说官网上web端js api开发文档里的“显示地图”,复制粘贴代码到websotrm后脚本会提示AMap这个变量Unresloved,
更郁闷的是这些变量也没法go to define,但他们都可以正常运行,是什么原因导致这些代码中的变量明明unresloved,却仍然能正常运行啊
附上那个例子的代码,AMap显示unresolved
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<title>基本地图展示</title>
<link rel="stylesheet" href="http://cache.amap.com/lbs/static/main1119.css"/>
<script src="http://cache.amap.com/lbs/static/es5.min.js"></script>
<script src="http://webapi.amap.com/maps?v=1.3&key=您申请的key值"></script>
<script type="text/javascript" src="http://cache.amap.com/lbs/static/addToolbar.js"></script>
</head>
<body>
<div id="container"></div>
<script>
var map = new AMap.Map('container', {
resizeEnable: true,
zoom:11,
center: [116.397428, 39.90923]
});
</script>
</body>
</html>