jQuery tagit-没有这样的方法“添加" [英] jQuery tagit - No such method 'add'

查看:147
本文介绍了jQuery tagit-没有这样的方法“添加"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在搜索要向jquery tagit添加标签的方法时,我遇到了以下代码段:

Whilst searching for a away to add a tag to the jquery tagit, I came accross the following snippet:

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

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

However, this testing came accross this error:

错误:为tagit小部件实例没有这种方法添加"

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

此代码段适用于其他人,但不适合我...任何想法?

This snippet worked for someone else, but not me... any ideas?

推荐答案

尝试使用:

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

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

这篇关于jQuery tagit-没有这样的方法“添加"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆