0
<html>
  <head>
  <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
  (adsbygoogle = window.adsbygoogle || []).push({
    google_ad_client: "ca-pub-xxxxxxxxxx",
    enable_page_level_ads: true
  });
</script>
    <title>UN World Jobs</title>
     <meta charset="UTF-8"> 
    <link href="dist/jqvmap.css" media="screen" rel="stylesheet" type="text/css">
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src= " dist/jquery.vmap.js"></script>
    <script type="text/javascript" src="dist/maps/jquery.vmap.world.js" charset="utf-8"></script>
     <style>
    body {
        padding-top: 70px;
        /* Required padding for .navbar-fixed-top. Remove if using .navbar-static-top. Change if height of navigation changes. */
    }
    </style>

<style>
ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #333;
}

li {
    float: left;
    border-right:1px solid #bbb;

}

li:last-child {
    border-right: none;
}

li a {
    display: block;
    color: white;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
}

li a:hover:not(.active) {
    background-color: #111;
}

.active {
    background-color: #87CEFA;
}
</style>
<script type="text/javascript">
        jQuery(document).ready(function() {
     jQuery('#vmap').vectorMap({ 
    map: 'world_en',
    onRegionClick: function(element, code, region) {
        if(code == 'bi'){
            window.location.href = 'burundiJobs.html';
        }
        if(code == 'ne'){
            window.location.href = "NigerJobs.html";
        }
        if(code == 'ng'){
            window.location.href = 'NigeriaJobs.html';
        }
        if(code == 'eg'){
            window.location.href = "egyptJobs.html";
        }if(code == 'ml'){
            window.location.href = 'MaliJobs.html';
        }
        if(code == 'so'){
            window.location.href = "SomaliaJobs.html";
        }if(code == 'cd'){
            window.location.href = 'CongoJobs.html';
        }
        if(code == 'cf'){
            window.location.href = "centralJobs.html";
        }if(code == 'ke'){
            window.location.href = 'KenyaJobs.html';
        }
        if(code == 'lr'){
            window.location.href = "liberiaJobs.html";
        }
         if(code == 'na'){
            window.location.href = "namibiaJobs.html";
        }
        if(code == 'sd'){
            window.location.href = "sudanJobs.html";
        }
         if(code == 'na'){
            window.location.href = "namibiaJobs.html";
        }
        if(code == 'sl'){
            window.location.href = "sierraleoneJobs.html";
        }if(code == 'et'){
            window.location.href = "ethiopiaJobs.html";
        }if(code == 'zw'){
            window.location.href = "zimbabweJobs.html";
        }if(code == 'ug'){
            window.location.href = "ugandaJobs.html";
        }if(code == 'dj'){
            window.location.href = "djiboutiJobs.html";
        }if(code == 'tz'){
            window.location.href = "tanzaniaJobs.html";
        }if(code == 'cm'){
            window.location.href = "cameroonJobs.html";
        }

    }
    });
    });
    </script>

 <script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-91634038-1', 'auto');
  ga('send', 'pageview');

</script>
  </head>
  <body>
  <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <div class="container">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="#">Start Bootstrap</a>
            </div>
            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    <li>
                        <a href="#">About</a>
                    </li>
                    <li>
                        <a href="#">Services</a>
                    </li>
                    <li>
                        <a href="#">Contact</a>
                    </li>
                </ul>
            </div>
            <!-- /.navbar-collapse -->
        </div>
        <!-- /.container -->
    </nav>

  <h2 style="text-align: center; font-family: Arial Black,Arial Bold,Gadget,sans-serif; "> Welcome to UN World Jobs, please pick a country you would like to work.</h2>
  <div id="vmap" style="width: 800; height: 600; 
    margin: 0 auto; "></div>

 <!-- jQuery Version 1.11.1 -->
    <script src="js/jquery.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="js/bootstrap.min.js"></script>

  </body>
</html>

以上代码是带有JQVmap的Bootstrap空白模板代码。当我打开浏览器时,地图不会加载并在控制台中给我这个错误:

TypeError: jQuery(...).vectorMap is not a function[Learn More]. 

我的 JQVmap 文件夹都存在。

4

2 回答 2

0

<script>您在标签中有一个额外的空间

 <script type="text/javascript" src= " dist/jquery.vmap.js"></script>

应该

 <script type="text/javascript" src= "dist/jquery.vmap.js"></script>
于 2017-02-10T22:16:25.963 回答
0

我在最顶部添加了 jquery 并且它有效

        <link href="css/bootstrap.min.css" rel="stylesheet">
  <!-- jQuery Version 1.11.1 -->
    <script src="js/jquery.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="js/bootstrap.min.js"></script>

    <link href="dist/jqvmap.css" media="screen" rel="stylesheet" type="text/css">

    <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src= " dist/jquery.vmap.js"></script>
    <script type="text/javascript" src="dist/maps/jquery.vmap.world.js" charset="utf-8"></script>
于 2017-02-10T23:06:38.017 回答