Thread: Problem with IE
View Single Post
  #2 (permalink)  
Old August 23rd, 2007, 02:27 AM
joefawcett's Avatar
joefawcett joefawcett is offline
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts

Well if it works in other browsers then your web service is okay. My guess is that it's because you use:
function GetXmlHttpObject()
  var xmlHttp=null;
which redeclares the variable xmlHttp, meaning it's a different one to the var xmlHttp declared outside the function. Try removing the var. If this is the case then I believe IE is actually correct in its behaviour.

On a separate note IE 7 also supports new XMLHttpRequest() so don't assume that it's Mozilla if this part of the code works, it's often better to try new ActiveXObject first and then fall back to the built in object. You should also try to create IE's objects with the following class IDs in order:
  • MSXML2.XMLHttp.6.0
  • MSXML2.XMLHttp.3.0
  • Microsoft.XMLHTTP
that way you'll get the best and most reliable object available.


Joe (Microsoft MVP - XML)