【发布时间】:2012-01-30 14:20:03
【问题描述】:
这是我的 html 代码:
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jqueryui.js"></script>
<script>
$( "#tags" ).autocomplete({
url: 'Ajax.php?txt='
});
</script>
</head>
<body>
<div class="demo">
<div class="ui-widget">
<label for="tags">Tags: </label>
<input id="tags" name="txt" />
</div>
</div>
</body>
</html>
这是我的 Ajax.php
<?
$val = $_REQUEST["txt"];
if($val == "251") { echo "its WoooW";}
else
echo "Nothing found";
?>
但它不适用于自动完成功能。 我的错误是什么?
【问题讨论】:
-
我可能是错的,但我认为您误读了自动完成功能的工作原理。乍一看,在我看来,您是在尝试“重新发明”轮子,而不是让 jQuery 完成“工作”
-
@user1178177 查看我的回答,希望对您有所帮助
标签: php jquery autocomplete