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"
8 comments:
What is the XMLHttpRequest object?
It offers a non-blocking way for JavaScript to communicate back to the web server to update only part of the web page.
Is the XMLHttpRequest object part of a W3C standard?
No. Or not yet. It is part of the DOM Level 3 Load and Save Specification proposal.
How do I abort the current XMLHttpRequest?
Just call the abort() method on the request.
Is Ajax just another name for XMLHttpRequest?
No. XMLHttpRequest is only part of the Ajax equation. XMLHttpRequest is the technical component that makes the asynchronous server communication possible; Ajax is our name for the overall approach described in the article, which relies not only on XMLHttpRequest, but on CSS, DOM, and other technologies.
Post a Comment