$(...).tagsinput不是一个函数

aco*_*aco 2 javascript jquery twitter-bootstrap bootstrap-tags-input

我必须遗漏一些简单的东西,但我看不到它.我正在使用Bootstrap tagsinput插件,我试图按照这里的一些例子:http: //bootstrap-tagsinput.github.io/bootstrap-tagsinput/examples/

这是我的代码:

<html>
  <head>
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/bootstrap.tagsinput/0.4.2/bootstrap-tagsinput.css" />
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/bootstrap.tagsinput/0.4.2/bootstrap-tagsinput.min.js"></script>
  </head>
  <body>
    <input id="cities" class="form-control" value="New York,London" data-role="tagsinput" type="text">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
    <script>
      $(function() {
        $('#cities').tagsinput({
          maxTags: 3
        });
      });
    </script>
  </body>
</html>
Run Code Online (Sandbox Code Playgroud)

我收到以下Javascript错误:

tagsinput.html:15 Uncaught TypeError: $(...).tagsinput is not a function
Run Code Online (Sandbox Code Playgroud)

我尝试删除这个SO答案中的data-role="tagsinput"建议,但输入变为常规文本框,但仍然会发生异常.

我究竟做错了什么?

Ram*_*lfc 6

你在script标签中加载2个jquery min文件.

bootstrap-tagsinput.min.js在第二个版本加载之后或之后删除一个版本而不是第一个加载版本.

http://jsbin.com/xarasebibi/edit?html,output