gpt4 book ai didi

javascript - jQuery tagit - 没有这样的方法 'add'

转载 作者:行者123 更新时间:2023-11-28 15:37:14 25 4
gpt4 key购买 nike

在寻找向 jquery tagit 添加标签的方法时,我遇到了以下代码片段:

$('.tagfilter').click(function(){
$('#addtags').tagit('add', 'test value');
return false;
});

但是,这个测试遇到了这个错误:

Error: no such method 'add' for tagit widget instance

这段代码对其他人有效,但对我无效......有什么想法吗?

最佳答案

尝试使用:

$("#myTags").tagit("createTag", "brand-new-tag");

来源:https://github.com/aehlke/tag-it/blob/master/README.markdown

关于javascript - jQuery tagit - 没有这样的方法 'add',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25233444/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com