Asynchronous JavaScript and XML

Home

AJAX Tutorial
Knowledge Developer Database Internet Resource
Ѿ

<html>
<head>
<script type="text/javascript">
function showCD(str)
{
if (str=="")
{
document.getElementById("txtHint").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","getcd.php?q="+str,true);
xmlhttp.send();
}
</script>
</head>
<body>

<form>
͡մ:
<select name="cds" onchange="showCD(this.value)">
<option value="">͡մ:</option>
<option value=" ѡɳ кص"> ѡɳ кص</option>
<option value="ਹ ">ਹ </option>
<option value="Ѵ ͧز">Ѵ ͧز</option>
<option value=" ʵ"> ʵ</option>
<option value="ÿԹ">ÿԹ</option>
<option value=" ÿԹ"> ÿԹ</option>
<option value=" տ ҹԭ"> տ ҹԭ</option>
<option value="ѳ ʴ">ѳ ʴ</option>
<option value=" ع"> ع</option>
<option value=""></option>
<option value=""></option>
<option value="δ">δ</option>
<option value="Ҵ͡">Ҵ͡</option>
<option value=""></option>
</select>
</form>
<div id="txtHint"><b>ʹȫմʴŷ...</b></div>

</body>
</html>

͡մ:
ʹȫմʴŷ...

ʧǹԢԷ (C) widebase / Julaphak