EN
Este contenido no se encuentra disponible en su idioma, pero aquí tiene la versión en inglés.

onreadystatechange Property

Sets or retrieves the event handler for asynchronous requests.

Syntax

[ vHandler = ] object.onreadystatechange [ = v ]

Possible Values

vHandler Variant that specifies or receives the event handler.

The property is read/write. The property has no default value.

Remarks

onreadystatechange was introduced in Windows Internet Explorer 7.

Example

The following script demonstrates how to set an event handler that responds to asynchronous events:


function reportStatus()
{
    if (oReq.readyState == 4)
        alert('Transfer complete.');
}

var oReq = new XMLHttpRequest();
oReq.onreadystatechange = reportStatus;
oReq.open("GET", "http://localhost/test.xml", true);
oReq.send();

Standards Information

This property is defined in The XMLHttpRequest Object (W3C Working Draft) World Wide Web link.

Applies To

XMLHttpRequest, XMLHttpRequest Constructor

See Also

readyState

Adiciones de comunidad

Mostrar:
© 2014 Microsoft