Bootstrap Typeahead.js [英] Bootstrap Typeahead.js

查看:32
本文介绍了Bootstrap Typeahead.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图让引导程序提前输入工作,但没有任何运气.我已经粘贴了我拥有的代码.我有参考 Jquery-1.9.1 和 typeahead.js.我究竟做错了什么?非常感谢您的帮助!谢谢.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %><!DOCTYPE html><head id="Head1" runat="server"><script src="Scripts/typeahead.js-master/test/vendor/jquery-1.9.1.js"></script><script src="Scripts/typeahead.js-master/src/typeahead.js"></script><title></title><身体><表格><div><input type="text" data-provide="typeahead" autocomplete="off" data-source='["arizona","alaska"]'/>

</表单></html>

解决方案

您似乎对 typeahead.js(来自 Twitter)和 Twitter Bootstrap 的 Typeahead 功能

您正在包含 typeahead.js 的库

<script src="Scripts/typeahead.js-master/src/typeahead.js"></script>

但尝试像 Twitter Bootstrap 的预先输入功能一样使用它.

如果您想使用当前代码,请确保包含 Twitter Bootstrap 库:

<script type="text/javascript" src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>

这是一个例子:jsFiddle

I have been trying to get the bootstrap typeahead to work, with no luck whatsoever. I have pasted the code I have. I have reference Jquery-1.9.1 and typeahead.js. What am I doing wrong? Your help is much appreciated! Thanks.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>

<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<script src="Scripts/typeahead.js-master/test/vendor/jquery-1.9.1.js"></script>
<script src="Scripts/typeahead.js-master/src/typeahead.js"></script>
<title></title>
</head>
<body>
    <form>
    <div>
        <input type="text" data-provide="typeahead" autocomplete="off" data-source='["arizona","alaska"]' />
    </div>
    </form>
</body>
</html>

解决方案

It looks like you're getting confused between typeahead.js (by Twitter) and Twitter Bootstrap's Typeahead feature

You're including the library for typeahead.js

<script src="Scripts/typeahead.js-master/src/typeahead.js"></script>

but trying to use it like Twitter Bootstrap's typeahead feature.

Make sure you're including the Twitter Bootstrap library, if you want to use your current code:

<script type="text/javascript" src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>

Here's an example: jsFiddle

这篇关于Bootstrap Typeahead.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆