if (window.XMLHttpRequest)
  {
  xhttp=new XMLHttpRequest();
  }
else // Internet Explorer 5/6
  {
  xhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xhttp.open("GET","cd_catalog.xml",false);
xhttp.send("");

=============
this code working in IE but not working in Other Browser pls help me

Try this:

function ajaxHandler(endParams, returnId)
{
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
		{
			// Opera 8.0+, Firefox, Safari
			ajaxRequest = new XMLHttpRequest();
		} 
	catch (e)
		{
			// Internet Explorer Browsers
			try
				{
					ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
				} 
			catch (e) 
				{
					try
						{
							ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
						} 
					catch (e)
						{
							// Something went wrong
							alert("Your browser broke!");
							return false;
						}
				}
		}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function()
		{
			if(ajaxRequest.readyState == 4)
				{
					document.getElementById(returnId).innerHTML = ajaxRequest.responseText;
				}
		}
	
	ajaxRequest.open("GET", "the_path_to_page" + endParams, true);
	ajaxRequest.send(null); 
}

Took that straight from a tutorial somewhere. Works good for me

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.