I don't know what's the problem with this code. I've tried it on chrome and it worked. but in IE it isn't
Jquery code
$().ready(function() {
$("#loc").autocomplete("database.php", {
width: 260,
selectFirst: false
});
});
HTML code
<label>Location</label>
<input type="text" id="loc" />
<h3>Result:</h3> <ol id="result" style="border:1px solid red;"></ol>
PHP code
$term = strtoupper($_GET["q"]);
$query = mysql_query("SELECT * from entityspecs where entitycode like '%$term%' ") or die(mysql_error());
$res = array();
while($row = mysql_fetch_assoc($query)){
$enty = $row['entitycode'];
$res[$enty] = $enty;
}
foreach ($res as $key=>$value) {
if (strpos(strtoupper($key), $term) !== false) {
echo "$key|$value\n";
}
}