我有这个函数 bootstrap tags input插件:
$(document).ready(function () {
$('input').tagsinput({
typeahead: {
source: function (query) {
return $.getJSON('citynames.json');
}
}
})
});
但是这个插件不起作用。我认为它与 jQuery (document).ready
有冲突。我该如何解决这个问题?
JSFIDDLE (为了更好地理解代码)
最佳答案
试试这个
$(document).ready(function () {
$('input').tagsinput({
typeahead: {
source: function (query, process) {
process($.getJSON('citynames.json'));
}
}
})
});
关于jquery - Bootstrap 标签输入无法使用文档就绪,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21460702/