onreadystatechange通常用于XMLHttpRequest對象中,用于指定一個事件處理程序,在請求的狀態改變時被調用。具體來說,當readyState屬性發生改變時,就會觸發onreadystatechange事件。
一般來說,onreadystatechange可以在以下場合下使用: