以下是我的代码
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
我的HTML代码是
<div class="ui-widget">
<input name="searcharea" class="selectarea" id="searcharea" type="text" value="" placeholder="Area">
</div>
我的功能是
<script>
$(function(){
$( "#searcharea" ).autocomplete({
source: "suggestions.php"
});
$( "#searchcat" ).autocomplete({
source: "suggestions1.php"
});
});
</script>
我已将此页面包含在带有我网站搜索代码的单独文件中,并将其嵌入到各个页面中,在索引页面上,它建议我从源文件中获取值,但在其他页面上,它使我在网上出现typerror
$( "#searcharea" ).autocomplete({
我的网站链接是:http : //www.jodhpuryp.in/
这是我的自动提示框的来源http://api.jqueryui.com/autocomplete/
有人可以告诉我,为什么我在索引页面上工作时在网站的其他页面上遇到此错误。感谢您的帮助。
发现了问题,我为Google翻译添加了另一个jquery文件,它们相互冲突并导致未加载自动完成功能。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句