3
我正在使用Bootstrap-3 Typeahead plugin以及Bootstrap Tag Input plugin。我用这样的:jQuery Typeahead - 未捕获TypeError:无法读取未定义的属性“名称”
<input type="text" id="name" name="test" data-provide="typeahead">
而jQuery的:
$.get('/design/assets/advertisements/countries.json', function(data) {
$("#name").typeahead({
source: data
});
$('#name').tagsinput({
typeahead: {
source: data
}
});
}, 'json');
然而,预输入和标签工作的一些点。每当我输入一些单词时,我都会收到建议,但每当我选择一个建议时,我所写的任何内容都会在标签输入后添加。
例子:如果我写“Bah
”,然后选择“Bahamas
”,它看起来像这样:(这里我会相信它会删除“呸”)
我得到这个错误 - 我不知道如果是这样的原因:
Uncaught TypeError: Cannot read property 'name' of undefined
的误差调用这个文件:bootstrap3-typeahead.js
检查此问题http://stackoverflow.com/questions/29360584/twitter-bootstrap-3-typeahead-tagsinput-completing-twice – Dhiraj