다음 코드를 사용하여 콤보 박스에 데이터를 채 웁니다. Firefox 및 Chrome에서는 작동하지만 IE8에서는 작동하지 않습니다.IE8에서 작동하지 않는 콤보 상자
$.ajax({
type: "POST", url:"reg/data/data.php",
data: {
cat:"Y",
//toUser: "4",
// ignoreMessages:"1
},
success: function(data){
$.each(data, function (i, elem) {
$('#catogery').append(new Option(elem.id));
//console.log(elem);
});
}
});
PHP :
$result = mysql_query("SELECT DISTINCT CATCODE from subjectmaster");
$messages;
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);
나는 그것을 주석 처리하지만 이전과 동일합니다. 왜 IE에서만 발생합니까 –