jQuery tagit - No such method 'add'

我的未来我决定 提交于 2019-12-25 03:27:27

问题


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:

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

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


回答1:


Try using :

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

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



来源:https://stackoverflow.com/questions/25233444/jquery-tagit-no-such-method-add

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!