I have this ac.php file and this result.php file I want to use the autocomplete in JQuery UI in the ac.php file, but I want it to retrieve the data from result.php as a source. I just dont know how to do it. I tried this way, but its not working
ac.php
<html>
<head>
<link type="text/css" href="jqui/css/ui-lightness/jquery-ui-1.8.11.custom.css" rel="stylesheet" />
<script type="text/javascript" src="jqui/js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="jqui/js/jquery-ui-1.8.11.custom.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#tags").autocomplete("result.php");
});
</script>
</head>
<body>
<div class="ui-widget">
<label for="tags">Tags: </label>
<input id="tags">
</div>
</body>
</html>
this is result.php
<?php
$arrResults = array('option 1', 'option 2', 'option 3');
// Print them out, one per line
echo implode("\n", $arrResults);
?>
json_encode($arrResults). Also, have you checked on firbug to see whether the request/response is ok?