即使有类似的问题here,我找不到解决方案,所以这里是我能做的最简单的代码
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="well">
<input type="text" class="span3" id="search" data-provide="typeahead" data-items="4" />
</div>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.js"></script>
<script src="js/typeahead.js"></script>
<script>
var subjects = ['PHP', 'MySQL', 'SQL', 'PostgreSQL', 'HTML', 'CSS', 'HTML5', 'CSS3', 'JSON'];
$('#search').typeahead({source: subjects})
</script>
</body>
仍然无法找到问题所在。