Mrs. Sujata Oak Assistant Professor Department of IT: ITC602-Web X.O Module 6: Rich Internet Application
Mrs. Sujata Oak Assistant Professor Department of IT: ITC602-Web X.O Module 6: Rich Internet Application
Mrs. Sujata Oak Assistant Professor Department of IT: ITC602-Web X.O Module 6: Rich Internet Application
O
Module 6 : Rich Internet Application
THEORY
What is AJAX?
AJAX = Asynchronous JavaScript And XML.
xhttp.onload = function() {
// What to do when the response is ready
}
xhttp.open("GET", "ajax_info.txt");
xhttp.send();
xhttp.open("GET", "ajax_info.txt", true);
xhttp.send();
xhttp.open("GET", "ajax_test.asp", true);
The file can be any kind of file, like .txt and .xml, or server
scripting files like .asp and .php (which can perform actions on
the server before sending the response back).
By sending asynchronously, the JavaScript does not have to wait for the
server response, but can instead:
xhttp.open("GET", "ajax_info.txt", false);
<script>
function loadDoc() {
const xhttp = new XMLHttpRequest();
xhttp.onload = function() {
document.getElementById("demo").innerHTML = this.responseText;
}
xhttp.open("GET", "ajax_info.txt",false);
xhttp.send();
}
</script>
</body>
</html>