We help IT Professionals succeed at work.
Get Started

IE7 javascript createDocument issue :(

blandyuk asked
Last Modified: 2007-12-19
Hi Experts,

I have a problem where the below javascript wont work with IE7 :( I keep getting:
"Object doesn;t support this property or method"

Works fine in IE6 and Firefox. You'll see the alerts I've inserted to debug it. The problem line is:
"rt = document.implementation.createDocument('','',null);"

Any help will be great. Thanks.

function SoapService()
      //branch for Mozilla
      if (window.XMLHttpRequest)
        this.XmlHttp = new XMLHttpRequest();
            if (this.XmlHttp.overrideMimeType) {

    // branch for IE6 / Windows ActiveX version
    else if (window.ActiveXObject)
            this.XmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
function _callService(func,params,async)
      this.XmlHttp.open("POST", params[0], async);
      this.XmlHttp.setRequestHeader('Content-Type','text/xml; charset=UTF-8');
      this.XmlHttp.setRequestHeader('SOAPAction', '"'+params[1]+'"');
      var rt;
            var XmlHttpAsync=this.XmlHttp;
            var VersionAsync=this.Version;
            this.XmlHttp.onreadystatechange =function()
                  if(XmlHttpAsync.readyState != 4)return;
                        rt = document.implementation.createDocument('','',null);
                  else if(VersionAsync==1)
                        rt= XmlHttpAsync.responseXML.documentElement;
                  return true;

                  alert('LOOK AT THIS!! START');
                  rt = document.implementation.createDocument('','',null);
                  alert('LOOK AT THIS!! MID');
                  alert('LOOK AT THIS!! FIN');
            else if(this.Version==1)
                  rt= this.XmlHttp.responseXML.documentElement;
            return true;
            return false;
function XmlRegExp(IrregExp)
      var strXml=IrregExp.toString();
      return strXml.replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
Watch Question
IT Expert
Top Expert 2009
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE