Its my html code :
<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>
and here is my Ajax.php
<?
$val = $_REQUEST["txt"];
if($val == "251") { echo "its WoooW";}
else
echo "Nothing found";
?>
But it’s not working for autocomplete.
What is my mistake?
You must wrap your jquery into a function like this:
And you must return json_encoded content from Ajax.php (Example)
It States within the documentation: