http://jqueryui.com/autocomplete/
function getclassno(cat){
$.ajax({
type: "POST",
url:"reg/data/data.php",
data:{
catogery:cat
},
success: function(data){
$.each(data, function (i, elem) {
$('#classno').append( new Option(elem.id) );
});
}
);
$result = mysql_query("SELECT SUBJECTCODE FROM subjectmaster WHERE CATCODE = '$cat'");
header('Content-type: application/json');
$return_arr = array();
while($row = mysql_fetch_array($result))
{
$row_array['id']=$row[0];
array_push($return_arr,$row_array);
}
echo json_encode($return_arr);
}
我使用上面的代码用data.it在Firefox和Chrome中填充自动填充,但在IE8中不运行