onChange 이벤트의 다른 선택 상자를 기반으로 채워지는 선택 상자에서 작업하고 있습니다. 그것은 IE를 제외한 모든 브라우저에서 훌륭하게 작동합니다. onchange를이 단지 선택의 텍스트를 지 웁니다 발사 때.innerHTML이 IE에서 작동하지 않습니다.
function getVersion(str){
if (str==""){
document.getElementById("vSelect").innerHTML="<option value=''>Please Select a product</option>";
return;
}
if (window.XMLHttpRequest){
xmlhttp=new XMLHttpRequest();
} else {
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("vSelect").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","includes/version.php?product="+str,true);
xmlhttp.send();
}
그것은 IE에서이
<label>Version: </label>
<select id='vSelect'>
<option value=''>Please Select a product</option>
</select>
변경합니다. 어떤 아이디어? 라이브러리를로드하지 않고이 작업을 수행하려고합니다.
'innerHTML'이 (가) 끔찍하기 때문에 'innerHTML'을 사용하지 마십시오. 대신, '
@minitech 아, 고맙습니다 .-) –