jquery – Tagsinput不是一个函数,使用bootstrap 3和tags-input插件

栏目: jQuery · 发布时间: 5年前

内容简介:看起来如果你同时指定data-role =“tagsinput”并使用$(‘#idInputWhat’).tagsgput(‘add’,’vino’);然后它给出了这个错误.尝试删除data-role属性,并仅使用显式.tagsinput().我认为这是tagsinput插件中的一个错误.似乎在这里得到确认;

我正在使用带有jquery 1.10的bootstrap 3而且我想使用tags-input插件( http://timschlechter.github.io/bootstrap-tagsinput/examples/bootstrap3/ ),但它不起作用.

这是我的错误:

TypeError: tagsinput[arg1] is not a function
var retVal = tagsinput[arg1](arg2);

这是我的HTML代码:

<head>

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAv92iA1TcfCnk4-bDg7BAJoKOCnh1g7oQ&sensor=false"></script>

<link href="/qtip2/css/jquery.qtip.min.css" media="screen" rel="stylesheet" type="text/css" >
<link href="/css/bootstrap.min.css" media="screen" rel="stylesheet" type="text/css" >
<link href="/css/1309_ciceroos_b2b.css" media="screen" rel="stylesheet" type="text/css" >
<link href="/css/1310_longdistance.css" media="screen" rel="stylesheet" type="text/css" >
<link href="/bootstrap3.0.0/assets/css/bootstrap-tagsinput.css" media="screen" rel="stylesheet" type="text/css" ><script type="text/javascript" src="/bootstrap3.0.0/assets/js/jquery.js"></script>
<script type="text/javascript" src="/js/infobox.js"></script>
<script type="text/javascript" src="/qtip2/js/jquery.qtip.min.js"></script>
<script type="text/javascript" src="/qtip2/js/imagesloaded.min.js"></script>
<script type="text/javascript" src="/bootstrap3.0.0/dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/bootstrap3.0.0/assets/js/holder.js"></script>
<script type="text/javascript" src="/bootstrap3.0.0/assets/js/bootstrap-tagsinput.js"></script>
<script type="text/javascript">
                    jQuery(document).ready(function ($) {
                        //$('.bootstrap-tagsinput input').attr("value", "interessi");   
                        $('#idInputWhat').tagsinput('add', 'mare');
                        $('#idInputWhat').tagsinput('add', 'vino'); 

                        $('#idInputWhat').tagsinput({
                            maxTags: 3
                            });                         
                    });
                </script>
        </head>
        <body>
            <form class="form-inline" role="form" id="idFormSearch" method="GET" action="javascript:void(0);">
                                 <div class="form-group col-md-offset-1 col-md-5 _interestInput">
                                    <input type="text" placeholder="Quali sono le tue passioni?" data-role="tagsinput" class="form-control input-lg" name="what" id='idInputWhat' value=""/> 
                                </div>
                                <div class="form-group col-md-3 _interestInput">
                                    <input type="text" placeholder="dove"  class="form-control input-lg" name="where" id='idInputWhere' />
                                    <input type="hidden" name="start" id='idStart' value="0"/> 
                                </div>
                                 <div class="col-md-3 _searchButton">
                                    <input class="btn btn-primary btn-lg" type="submit" value="Ispirami!"></input>
                                  </div>
                              </form>
        </body>

请问,有什么建议吗?

看起来如果你同时指定data-role =“tagsinput”并使用$(‘#idInputWhat’).tagsgput(‘add’,’vino’);然后它给出了这个错误.尝试删除data-role属性,并仅使用显式.tagsinput().

我认为这是tagsinput插件中的一个错误.

似乎在这里得到确认; https://github.com/TimSchlechter/bootstrap-tagsinput/issues/42

翻译自:https://stackoverflow.com/questions/20125061/tagsinput-is-not-a-function-using-bootstrap-3-and-tags-input-plugin


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

The Photoshop Anthology

The Photoshop Anthology

Corrie Haffly / SitePoint Pty. Ltd. / 2006 / USD 39.95

The Photoshop Anthology is full-color, question-and-answer book for Web Designers who want to use Photoshop to build Websites and create better looking web graphics more effectively. The book covers: ......一起来看看 《The Photoshop Anthology》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具