pTutorial

New way to learn Programming

XMLHttpRequest properties

XMLHttpRequest object properties

onReadyStateChange

Determine the function called when the objects readyState changes.

xmlobj.onreadystatechange=function() {
.......
.......
}

readyState

State of request. An integer from 0 to 4.

            0-	Uninitilised 
            1-	Loading
            2-	Loaded
            3-	Interactive
            4-	Completed
xmlobj.onreadystatechange=function() {
if (xmlobj.readyState==4)
{
document.getElementById('uk').innerHTML=xmlobj.
getAllResponseHeaders();
}
}

In the above example uk is the id where data has been set. See the complete example.


responseText

Data returned from the server as a text string.

example

var temp = xmlobj.responseText;

responseXML

Data returned from the server as a XML document object.

example

var temp = xmlobj.responseXML;

status

HTTP status code returned from the server.

statustext example

var statustxt1 = xmlobj.status;

statusText

HTTP status phrase returned from the server.

statustext example

var statustxt1 = xmlobj.statusText;

See Also


QUOTES OF THE DAY

Wicked men obey from fear, good men from love

LIKE ON FACEBOOK

+1 ON GOOGLE

SHARE ON TWITTER