【问题标题】:jQuery tagit - No such method 'add'jQuery tagit - 没有这样的方法“添加”
【发布时间】:2014-08-10 22:03:34
【问题描述】:

在搜索离开以向 jquery tagit 添加标签时,我遇到了以下 sn-p:

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

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

错误:tagit 小部件实例没有这样的方法“添加”

这个 sn-p 为其他人工作,但不是我......有什么想法吗?

【问题讨论】:

  • 如果您费心查看您正在使用的插件版本的文档,您是否找到add 方法?
  • 是的,抱歉,在提问后搜索时发现。非常感谢。

标签: javascript jquery tags tag-it


【解决方案1】:

尝试使用:

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

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

【讨论】:

    猜你喜欢
    • 2011-11-23
    • 1970-01-01
    • 2012-12-26
    • 2018-12-14
    • 2015-08-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-11
    • 2017-10-02
    相关资源
    最近更新 更多