Creating an XMLHttpRequest Object in JavaScript Video Tutorial 10 ~ Ajax Training, Learn Ajax Video Tutorials Online, Ajax Examples
Ajax Training, Learn Ajax Video Tutorials Online, Ajax Examples: Creating an XMLHttpRequest Object in JavaScript Video Tutorial 10

Creating an XMLHttpRequest Object in JavaScript Video Tutorial 10




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"

Related Posts by Categories

8 comments:

Saritha said...

What is the XMLHttpRequest object?

Srikanth said...

It offers a non-blocking way for JavaScript to communicate back to the web server to update only part of the web page.

Saritha said...

Is the XMLHttpRequest object part of a W3C standard?

Srikanth said...

No. Or not yet. It is part of the DOM Level 3 Load and Save Specification proposal.

Saritha said...

How do I abort the current XMLHttpRequest?

Srikanth said...

Just call the abort() method on the request.

Saritha said...

Is Ajax just another name for XMLHttpRequest?

Srikanth said...

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.

Useful Links on Adobe Flex

Your Ad Here

Latest Books on Adobe Flex