[英]Typeahead doesn't work with Bootstrap 3
我無法使它工作。 我在控制台上沒有任何錯誤。 該列表根本沒有出現。
這是我的html代碼:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<script type="text/javascript" src="/static/js/bootstrap.min.js"></script>
<script src="/static/js/typeahead.jquery.js"></script>
<form method="POST" class="search-form" name="search-form">
<input id="keywords" name = "searchtext" type="text" class="search-input" placeholder="Enter your text..." autocomplete="off">
<button type="submit" class="search-submit">Search Now</button>
</form>
<script type="text/javascript">
$(function(){
// applied typeahead to the text input box
$('#keywords').typeahead({
name: 'keywords',
// data source
local: ['pattern recognition', 'supervised learning', 'support vector machines'],
// max item numbers list in the dropdown
limit: 10
});
});
</script>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.