"Object Required" by IE 6 when using Msxml2.XMLHTTP
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

"Object Required" by IE 6 when using Msxml2.XMLHTTP

From: Brent <"writeBrent>
Date: Mon Nov 14 2005 - 04:16:23 CET

This AJAX stuff is all new to me. To try it out, I borrowed this code
from a website:

========================

var http_request = false;
     function makeRequest(url) {

         http_request = false;

         if (window.XMLHttpRequest)
         { // Mozilla, Safari,...
             http_request = new XMLHttpRequest();
             if (http_request.overrideMimeType)
             {
                 http_request.overrideMimeType('text/xml');

             }
         }
         else if (window.ActiveXObject)
         { // IE
             try
             {
                        http_request = new ActiveXObject("Msxml2.XMLHTTP");
                //Failure on above line!
             }
             catch (e)
             {
                 try
                 {
                 http_request = new ActiveXObject("Microsoft.XMLHTTP");
                 }
                 catch (e)
                 {
                 }
             }
         }
=======================

In Firefox and Safari, I'm having great success. In IE 6, I get an
"Object Required" failure while trying to run this line:

http_request = new ActiveXObject("Msxml2.XMLHTTP");

I guess I'm missing something pretty basic. Can someone point me in the
right direction?

Thanks!

--Brent
Received on Mon Nov 21 03:28:23 2005