jvectormap uncaught typeerror

问题描述 投票:1回答:1

我一直试图让这个插件工作几个小时,似乎无法这样做。我对jquery相当新,所以如果我说一些愚蠢的话,我会道歉:)我尝试按照网站上提供的教程但没有运气。无论如何我的代码到目前为止是:

<!doctype html>
<html>
<head>
  <meta charset="utf-8">
    <title> vectormap </title>
  <link rel="stylesheet" media="all" href="css/jquery-jvectormap-1.2.2.css">
  <script src="js/jquery-1.8.2.js"></script>
  <script src="js/jquery-jvectormap-1.2.2.min.js"></script> 
  <script src="js/jquery-mousewheel.js"></script>
  <script src="js/jvectormap.js"></script> 
  <script src="js/map.js"></script>
  <script src="js/jquery-jvectormap-au-mill-en.js"></script> 
</head>
<body>
  <div id="map" style="width: 100%; height: 400px"></div>
   <script>
    $(function(){
      $('#map').vectorMap({map: 'au_mill_en'});
    });
  </script>
</body>
</html>

我得到的错误是:1。未捕获TypeError:无法读取未定义的属性'maps'2.未捕获TypeError:undefined不是函数

感谢任何帮助,因为这是我的头!

干杯

抱歉没有正确缩进

jquery typeerror jvectormap
1个回答
0
投票

在包含任何插件库之前,必须包含jquery库。所以把第一个库包含在下面 -

<script src="js/jquery-1.8.2.js"></script>

如下

<head>
 <meta charset="utf-8">
<title> vectormap </title>
<!--<link rel="stylesheet" media="all" href="css/jquery-jvectormap.css" /> -->
<link rel="stylesheet" media="all" href="css/jquery-jvectormap-1.2.2.css" />
<!-- must be the first library to include as this is prerequisite for other plugins . lib-->
<script src="js/jquery-1.8.2.js"></script>
<script src="js/jquery-jvectormap-au-mill-en.js"></script> 
<script src="js/jquery-mousewheel.js"></script>
<script src="js/jquery-jvectormap-1.2.2.min.js"></script>
<script src="js/jquery-jvectormap.js"></script>
<script src="js/jvectormap.js"></script> 
<script src="js/map.js"></script> -->
</head>
© www.soinside.com 2019 - 2024. All rights reserved.