AJAX - onreadystatechange ???
onreadystatechange ???
??? ??? ???? ? ?? ?? ?? ??? ???? ???.
readyState? ??? ??? onreadystatechange ???? ??????.
readyState ??? XMLHttpRequest? ?? ??? ?????.
??? XMLHttpRequest ??? ? ?? ??? ?????:
????????????????????????????????????????????????????????????????????????????????????????????????? ??? ?????. readyState
XMLHttpRequest? ??? ?????. 0?? 4? ?????. 0: ??? ????? ???? ????? 1: ?? ??? ??????? 2: ??? ???????3: ?? ?? ?
4: ??? ?????? ??? ????????? 200: "OK" 404: ???? ?? ? ?? onreadystatechange ?????? ?? ??? ??? ??? ??? ? ??? ??? ?????. readyState? 4?? ??? 200?? ??? ?????? ?????.
xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("myDiv").innerHTML=xmlhttp.responseText; } }??: onreadystatechange ???? ? ReadyState ??? ?? 5?(0 - 4) ??????. ?? ?? ???? ?? ??? ?? ??? ????? ???? ?????. ? ???? ?? AJAX ??? ?? ?? XMLHttpRequest ??? ???? ?? ?? ??? ???? ? AJAX ??? ?? ? ??? ???? ???. ?? ???? onreadystatechange ???? ??? ? ??? URL? ??? ????? ???(???? ?? ? ??):
function myFunction() { loadXMLDoc("ajax_info.txt",function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("myDiv").innerHTML=xmlhttp.responseText; } }); }