【发布时间】:2016-06-24 10:48:35
【问题描述】:
<html>
<head>
<script src="js/typeahead.js"></script>
<script>
$(document).ready(function() {
$('input.doctor').typeahead({
name: 'doctor',
remote: 'doctor.php?query=%QUERY'
});
})
</script>
</head>
<body>
<form>
<input type="text" name="doctor" size="30" class="doctor" placeholder="Please Enter City or ZIP code">
</form>
</body>
</html>
error TypeError: $(...).typeahead 不是函数 我还包括 typehead.js 文件
【问题讨论】:
-
您忘记在
typeahead.js之前添加jQuery。