我有这个函数 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'));
}
}
})
});
