Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/461.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript x-可编辑+;引导程序3+;Twitter typeahead.js不工作_Javascript_Twitter Bootstrap 3_Typeahead.js_X Editable - Fatal编程技术网

Javascript x-可编辑+;引导程序3+;Twitter typeahead.js不工作

Javascript x-可编辑+;引导程序3+;Twitter typeahead.js不工作,javascript,twitter-bootstrap-3,typeahead.js,x-editable,Javascript,Twitter Bootstrap 3,Typeahead.js,X Editable,我尝试将Bootstrap3与令人敬畏的x-editable和typeahead.js集成,但无法实现: 我尝试了以下方法 使用数据类型='typeaheadjs'标记元素 将type='typeaheadjs'添加到$().editable()中 将所有参数移动到数据-*属性 将所有参数移动到$().editable()参数 但是没有运气 HTML代码: <div style="margin: 150px"> <a href="#" id="username"&g

我尝试将Bootstrap3与令人敬畏的x-editable和typeahead.js集成,但无法实现:

我尝试了以下方法

  • 使用数据类型='typeaheadjs'标记元素
  • 将type='typeaheadjs'添加到$().editable()中
  • 将所有参数移动到数据-*属性
  • 将所有参数移动到$().editable()参数
但是没有运气

HTML代码:

<div style="margin: 150px">
    <a href="#" id="username">Rome</a>
</div>
在这里拉小提琴:

即使是在提供的示例也不适用于我


我做错了什么?

您需要包括typeahead.min.js和typeaheadjs.js

正如你在这把小提琴上看到的

他正在解决这个问题

您可以在目录inputs ext/typeaheadjs的zip存档中找到typeaheadjs.js:

$('#username').editable({
    mode: 'inline',
    showbuttons: false,
    type: 'text',
    url: '/post',
    pk: 1,
    title: 'Enter an Italian city',
    typeahead: {
        local: ['Rome', 'Milan', 'Venice', 'Florence']
    }
});        
http://cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.0/inputs-ext/typeaheadjs/typeaheadjs.js