Ani*_*nil 2 javascript jquery handlebars.js bootstrap-typeahead
我一直在为Handlebars.compile()调用获取TypeError.我尝试将jQuery.noConflict()添加到其他一些帖子中建议的各个地方,但没有运气.
TypeError: 'undefined' is not a function (evaluating 'Handlebars.compile('test')')
Run Code Online (Sandbox Code Playgroud)
代码是:
$('.location-typeahead').typeahead(
{
name: 'states',
displayKey: 'value',
source: states(),
templates: {
header: '<h4 class="location-typeahead-header">Title</h4>',
suggestion: Handlebars.compile('test')
}
}
);
Run Code Online (Sandbox Code Playgroud)
如果我删除整个"suggestion"模板参数,我的JS工作正常.
| 归档时间: |
|
| 查看次数: |
2032 次 |
| 最近记录: |