AJAX Stands for Asynchronous JavaScript And XML.which means we can interact with server asychronous manner.In this clip, Learn how to create XMLHttpRequestObject, which connects to the server for Microsoft and Non-Microsoft browsers.
Creating XMLHttpRequestObject varies by browsers
for checking Non-Microsoft Browsesrs, we use window.XMLHttpRequest
if this expression returns true then
XMLHttpRequestObject = new XMLHttpRequest();
statement to create new XMLHttpRequestObject
for Microsoft Browsers, we use window.ActiveObject expression
if this expression returns true then
XMLHttpRequestObject = new ActiveXObject();
to create the new XMLHttpRequestObject.
<script language = "javascript">
var XMLHttpRequestObject = false;
if (window.XMLHttpRequest) {
XMLHttpRequestObject = new XMLHttpRequest();
} else if (window.ActiveXObject) {
XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");
}
</script>
Know more about How to Create XMLHttpRequest object for Microsoft and Non Microsoft Browsers ?.
For the Ajax source code demonstrated in this video, follow this link "Fetching Data with Ajax"