Hi Friends
In this section will see that how to Server Response to browser(client) and what basics response come back to browser
AJAX Server Response to browser
There are two methods property in server response
1.responseText
2.responseXML
the above XMLHttpRequest object to get response data as string than we can use above method in following way
xhttp.responseText
the above XMLHttpRequest object to get response data as XML than we can use above method in following way
xhttp.responseText
Ok fine!
Then how to use this code in script and how to update particular part without reloading the whole webpage
document.getElementById("updateArea").innerHTML = xhttp.responseText;
document.getElementById("updateArea").innerHTML = xhttp.responseTextXML;
This above code inside the onreadystatechange event like it
xhttp.onreadystatechange = function()
{
if (xhttp.readyState == 4 && xhttp.status == 200) {
document.getElementById("updateArea").innerHTML = xhttp.responseText;
}
};
Next section will post Live time example scripts
Thank You!
In this section will see that how to Server Response to browser(client) and what basics response come back to browser
AJAX Server Response to browser
There are two methods property in server response
1.responseText
2.responseXML
the above XMLHttpRequest object to get response data as string than we can use above method in following way
xhttp.responseText
the above XMLHttpRequest object to get response data as XML than we can use above method in following way
xhttp.responseText
Ok fine!
Then how to use this code in script and how to update particular part without reloading the whole webpage
document.getElementById("updateArea").innerHTML = xhttp.responseText;
document.getElementById("updateArea").innerHTML = xhttp.responseTextXML;
This above code inside the onreadystatechange event like it
xhttp.onreadystatechange = function()
{
if (xhttp.readyState == 4 && xhttp.status == 200) {
document.getElementById("updateArea").innerHTML = xhttp.responseText;
}
};
Next section will post Live time example scripts
Thank You!
No comments:
Post a Comment