Tag Archive | "new XMLHttpRequest"

Tags: , , , ,

Creating an XMLHttpRequest Object

Posted on 05 February 2012 by Moki

Browsers IE7+, Firefox, Chrome, Safari and Opera at this point have built in what is called the XMLHttpRequest object. This XMLHttpRequest object is used to send a receive data with a server in the background making it possible to update sections of a web page without reloading the browser window.

Proper Syntax for creating an XMLHttpRequest Object:

variable=new XMLHttpRequest();

Example of an XMLHttpRequest Object being used:

var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();

This XMLHttpRequest object is backbone of AJAX and is used extensively with the AJAX method.

Comments (0)