2017-05-14 62 views
0

出於某種原因,基本預輸入示例不上我的任何Web服務器的工作,但我能得到它的工作在這裏 - http://jsfiddle.net/H4Qmh/12/基本引導預輸入與例如

代碼中的任何分歧或問題比較之下代碼發佈在jsfiddle上?你能確認下面的代碼適合你嗎? (你應該能夠只需鍵入小時,看到的結果,我或多個)

<html> 
<head> 
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet" type="text/css" /> 
<script src="https://code.jquery.com/jquery.js" type="text/javascript"></script> 
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.js" type="text/javascript"></script> 
</head> 
<body> 
<div class="well"> 
<input autocomplete="off" type="text" class="span3" data-provide="typeahead" data-items="4" placeholder="Type in letter h, i or s" data-source='["iPhone", "HTC", "Samsung"]' > 
</div> 
</body> 
</html> 
+0

您必須提供在服務器 –

回答

2

我剛剛替換爲引導預輸入js文件的引導。並開始運行。

https://github.com/biggora/bootstrap-ajax-typeahead/tree/master/src

+0

多麼美妙的幫助下使用的代碼!我剛下載'的https:// raw.githubusercontent.com/biggora /自舉-Ajax的預輸入/主/ SRC /自舉-typeahead.js'和替換引導腳本符合''。有效。 –

1
<html> 
<head> 

    <!-- jquery--> 
    <script src="https://code.jquery.com/jquery.js"></script> 

    <!-- Bootstrap --> 
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> 
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.js"></script> 
</head> 
<body> 
    <div class="well"> 
     <input autocomplete="off" type="text" class="span3" data-provide="typeahead" data-items="4" placeholder="type in letter h, i or s" data-source='["iPhone", "HTC", "Samsung"]'> 
    </div> 
</body> 
</html> 

bootstrap cdn鏈接已返回你的HTML文件,而不是一個CSS文件。