Page 1 of 1

AJAX CODE WORKING WITH MOZILA & NETSCAPE BUT NOT WITH IE

Posted: Fri Jan 02, 2009 7:16 am
by anujphp
i am checking the presence of username while registering for my site and displaying the result using AJAX,it is working fine with mozilla and netscape and flock but now working with Internet explorer,i tried with different version of IE but none works,please help me,i am giving the js file code

Code: Select all

// JavaScript Document
 
var xmlHttp //this will return the xmlhttp request
 
function GetXmlHttpObject()
{
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;
}
 
//function to receive the new username and check whether th browser support ajax
function showUser(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="checkuser.php"
url=url+"?user="+str
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
 
//function to receive data from php page
function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("txtHint").innerHTML=xmlHttp.responseText 
 } 
}
THANK YOU IN ADVANCE

Re: AJAX CODE WORKING WITH MOZILA & NETSCAPE BUT NOT WITH IE

Posted: Fri Jan 02, 2009 12:06 pm
by Syntac
Sorry, your gratuitous use of uppercase letters has made me not want to help you.

Re: AJAX CODE WORKING WITH MOZILA & NETSCAPE BUT NOT WITH IE

Posted: Sun Jan 04, 2009 3:50 am
by anujphp
sorry if i have offended you,i did not mean to offend anyone.i cant force anyone to help me,i have requested everynone to help me in solving my this problem which i am facing.

Re: AJAX CODE WORKING WITH MOZILA & NETSCAPE BUT NOT WITH IE

Posted: Mon Jan 05, 2009 2:04 am
by anujphp
thank you.this problem is solved now