[thelist] JavaScript (Ajax) question - IE

Tom Dell'Aringa pixelmech at yahoo.com
Wed Nov 9 21:26:18 CST 2005


--- Joshua Olson <joshua at waetech.com> wrote:

> I've had pretty good luck with this block of code for creating the object:
> 
> function jb()
> {
>   var A=null;
>   try
>   {
>     A=new ActiveXObject("Msxml2.XMLHTTP")
>   }
>   catch(e)
>   {
>     try
>     {
>       A=new ActiveXObject("Microsoft.XMLHTTP")
>     }
>     catch(oc)
>     {
>       A=null
>     }
>   }
>   if(!A&&typeof XMLHttpRequest!="undefined")
>   {
>     A=new XMLHttpRequest()
>   }
>   return A
> }  
> 
> It's the code Google first used when they launched Google Suggest, so I'm
> fairly confident it'll work.  :-)

Dang, it still errors out! :( I was confident too! Could this possibly be a local setting issue?
In any event, I put some alerts in the function you supplied, it errors out without ever entering
the catch block or the 'undefined' block.

Current page at:

http://www.pixelmech.com/ajax/ajaxController.html

JS is inline.. I'm fairly sure I have it implemented fine, it still works in FireFox just peachy.
Does it work for anyone else in IE?

Tom


http://www.pixelmech.com/
"I was in a convenience store reading a magazine and the clerk came up to me and said "This is not a library". so I said, "All right, I will talk louder then!"



More information about the thelist mailing list