undefined function initializing taginput bootstrap 3(未定义的函数初始化标记输入引导程序 3)
问题描述
我正在尝试为 bootstrap 3 实现 TagInput 但是当我尝试初始化它,它给了我一个错误 Uncaught TypeError: Property 'undefined' of object #<TagsInput>不是函数
I'm try to implement TagInput for bootstrap 3 but when i try to inizialize it, it give me a error Uncaught TypeError: Property 'undefined' of object #<TagsInput> is not a function
这是我调用脚本的方式
<script src="Jmx0Oz9waHAgZWNobyBiYXNlX3VybCgpID8mZ3Q7cmVzb3VyY2VzL2pzL2pxdWVyeS0xLjcuMi5taW4uanM=" type='text/javascript'></script>
<script src="Jmx0Oz9waHAgZWNobyBiYXNlX3VybCgpID8mZ3Q7cmVzb3VyY2VzL2pzL2Jvb3RzdHJhcC5qcw==" type='text/javascript'></script>
<script src="Jmx0Oz9waHAgZWNobyBiYXNlX3VybCgpID8mZ3Q7cmVzb3VyY2VzL2pzL2Jvb3RzdHJhcC10YWdzaW5wdXQuanM=" type='text/javascript'></script>
<script> $('.tagplayer').tagsinput();</script>
表格
<input type="text" class="tagplayer">
我目前不再使用此插件,我需要建议接受正确的答案.
推荐答案
我遇到了同样的问题.可能作者修改后忘记测试了.打开bootstrap-tagsinput.js,在最后一行可以看到如下代码;
I got the same problem. May the author forgot to test after some revision. Open bootstrap-tagsinput.js, and at the last line you can see the following code;
$(function() {
$("input[data-role=tagsinput], select[multiple][data-role=tagsinput]").tagsinput();
});
如你所见,在这段js代码中,调用了tagsinput()
函数.因此,包括您在代码中对 tagsinput()
的调用,对 tagsinput()
的调用有 2 次.
As you can see, in this js code, tagsinput()
function is called.
Hence, including your call to tagsinput()
in your code, there are 2 calls to tagsinput()
.
因此,在第 357 行,将 tagsinput()
函数注册为 jquery 插件,初始化失败.
As a result, at line 357 where registering tagsinput()
function as a jquery plugin,
the initializing is failed.
要解决这个问题,请注释上面的代码.(但也许你可以使用一些功能,但并不重要
To solve this, comment upper code. (But maybe you can use some functionalties, but not importan
无论如何,您也需要包含 bootstrap-tagsinput.css
.
Anyway, you need to include bootstrap-tagsinput.css
too.
这篇关于未定义的函数初始化标记输入引导程序 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:未定义的函数初始化标记输入引导程序 3


- addEventListener 在 IE 11 中不起作用 2022-01-01
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- 失败的 Canvas 360 jquery 插件 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- Flexslider 箭头未正确显示 2022-01-01
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06