Hi,
In navDone and statechanged function,response text xmlHttp2.responseText; is coming null.If i put alert before it i.e. alert(' ') and assign response text then it works properly.but i dont want alert before it.please help me.
Code:
function showStates(str) {
	//This sub will populate a table with all the states and get the 
	//pagination built
	
	//Make the AJAX connection for both the navigation and content
	xmlHttp=GetXmlHttpObject();
	xmlHttp2=GetXmlHttpObject();
	
	//If we cant do the request error out
	if (xmlHttp==null || xmlHttp2==null ) {
	 	alert ("Browser does not support HTTP Request");
	 	return
	}
	//First build the navigation panel
	var url="getQuestion.php";
	url=url+"?p="+str;
	url=url+"&t=nav"+"&"+window.location.search.substring(1);
	url=url+"&sid="+Math.random();
	alert(url);
	//Once the page finished loading put it into the div
	xmlHttp2.onreadystatechange=navDone; 

	//Get the php page
	xmlHttp2.open("GET",url,true);
	xmlHttp2.send(null);
	
	//Build the url to call
	//Pass variables through the url
	var url="getQuestion.php";
	url=url+"?p="+str;
	url=url+"&t=con";
	url=url+"&sid="+Math.random();
	
	//Once the page finished loading put it into the div
	xmlHttp.onreadystatechange=stateChanged; 
	
	//Get the php page
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function navDone() {
	var temp ="";
	//IF this is getting called when the page is done loading then fill the pagination div
	if (xmlHttp2.readyState==4) { 
	 	//Update the Div tag with the outputted text
		temp = temp + xmlHttp2.responseText;
		
		
	} 
	document.getElementById("pgNavigation").innerHTML=temp; 
}

function stateChanged() { 
	//IF this is getting called when the page is done loading the states then output the div
	if (xmlHttp.readyState==4) { 
	 	//Update the Div tag with the outputted text
		//alert('');
		document.getElementById("pgContent").innerHTML=xmlHttp.responseText; 
	} 
}

function GetXmlHttpObject() {
	//Determine what browser we are on and make a httprequest connection for ajax
	var xmlHttp=null;

	try {
	 	// Firefox, Opera 8.0+, Safari
	 	xmlHttp=new XMLHttpRequest();
	}
	catch (e) {
	 	//Internet Explorer
	 	try {
	  		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	  	}
	 	catch (e) {
	  		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	  	}
	}
	
	return xmlHttp;
}
Thanks