[Javascript] starting with ajax

Michael Borchers list at tridemail.de
Mon May 8 04:33:59 CDT 2006


  From: Michael Borchers 
  To: javascript at LaTech.edu 
  Sent: Monday, May 08, 2006 10:23 AM
  Subject: [Javascript] starting with ajax


  i use this function to create the ActiveX for Ajax and it works fine in FF, but IE always gets the result "null".
  guess the problem is the IE config or some SP2 prob?!

  if(navigator.appName.search("Microsoft") > -1)
  {
   //resObjekt = new ActiveXObjekt("Microsoft.XMLHTTP");
   resObjekt = new ActiveXObjekt("MSXML2.XMLHTTP");

  }
  else
  {
   resObjekt = new XMLHttpRequest();

  }

  alert(resObjekt);    
ok, i brought it down to these two functions, the first one works, the last not, though they do the same thing,
don't they?

var resObjekt;

if (window.XMLHttpRequest) { // Mozilla, Safari, ...
    resObjekt = new XMLHttpRequest();
} else if (window.ActiveXObject) { // IE
    resObjekt = new ActiveXObject("Microsoft.XMLHTTP");
}


if(navigator.appName.search("Microsoft") > -1)
{
 resObjekt = new ActiveXObjekt("Microsoft.XMLHTTP");
}
else
{
 resObjekt = new XMLHttpRequest();
}


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20060508/8d9d6854/attachment.htm>


More information about the Javascript mailing list