This project is archived and is in readonly mode.

#739 ✓resolved
lukasbuenger

Browser.Request issue

Reported by lukasbuenger | August 27th, 2009 @ 02:42 PM | in 1.2.4

Tested with v1.2.1, build 0d4845aab3d9a4fdee2f0d4a6dd59210e4b697cf

Hi everybody,

I was working on a project for a company who still uses IE6 with a jscript engine older than version 5. The project relies heavily on AJAX-Requests, which we implemented by using mootools' Request-class. The requests worked well with IE6 in general, but not with the configuration of the browser used by this company. I went through the sources and finally stumbled upon the mootools Request-factory Browser.Request, which grants no compatibility with ms browsers using jscript-engines older than version 5. However, this could be easily fixed. The ActiveXObject-type must simply be "Microsoft.XMLHTTP" instead of "MSXML2.XMLHTTP" when an older js engine version is detected.
My solution to the problem was an overwrite of the given factory using a very old-fashioned creation procedure of request objects. This can be found in my attachement.

Regards
Lukas

Comments and changes to this ticket

  • Scott Kyle

    Scott Kyle August 27th, 2009 @ 09:48 PM

    • State changed from “new” to “invalid”

    Hi, I think this is a great tip for those trying to find an answer to this problem, and so I'm glad you wrote this and that it'll get picked up by search engines. However, I don't believe we support those older JScript engines, so I'm going to mark this invalid. But please don't that as your ticket was unappreciated. :-)

  • lukasbuenger

    lukasbuenger August 31st, 2009 @ 09:44 AM

    Hi,

    No hard feelings, it is just a suggestion after all.
    However, I did a little extra investigating once more and found the following comment on this issue over at the asp.net forums:

    (http://forums.asp.net/t/1000060.aspx?PageIndex=2)

    "Microsoft.XmlHttp is the ProgID of the XMLHTTPRequest object found in msxml.dll, while MSXML2.XmlHttp is found in msxml2.dll. In Windows XP, you can find both DLLs; in Windows Vista only msxml2.dll is found. If you only have msxml.dll, then Microsoft.XmlHttp is your only way to go; if you have the newer version, its installer redirected Microsoft.XmlHttp to the newer MSXML2.XmlHttp object found in mxml2.dll, resulting in identical objects."

    This is the actual reason for the issue I explained above, so forget about JScript versions. Instantiating with the Microsoft namespace seems to be appropriate as it results in an identical object (as long as you need it as a simple responseText/responseXML-Request) and grants full IE6-compatibility. And given the still high numbers of XP users and IE 6, it is not unlikely to have an IE6 in an XP environment that refuses to process ANY request made with the Browser.Request-function. For a framework that claims to be fully IE 6-compatible that seems a little inconvenient, I guess. And for my decision to use Mootools IE6-compatibility was crucial and could be easily achieved (at least as far as requests are concerned).

  • Scott Kyle

    Scott Kyle August 31st, 2009 @ 04:43 PM

    • Assigned user set to “Scott Kyle”
    • State changed from “invalid” to “open”

    Wow, thanks for the digging. So you're saying that your client's machines are missing msxml2.dll? Why would they be missing that DLL? Are they using Win2k?

  • lukasbuenger

    lukasbuenger August 31st, 2009 @ 04:58 PM

    • Assigned user cleared.

    No. It depends on the service pack and its updates.
    http://support.microsoft.com/kb/269238/en

  • lukasbuenger

    lukasbuenger August 31st, 2009 @ 04:59 PM

    • Assigned user set to “Scott Kyle”
  • Scott Kyle

    Scott Kyle August 31st, 2009 @ 05:56 PM

    Dammit Microsoft!!! :-)

    Please try this and let me know if it works: http://gist.github.com/178569

    Thanks

  • lukasbuenger

    lukasbuenger September 1st, 2009 @ 08:54 AM

    Worked perfectly! Thanks!! I really appreciate it.

  • Scott Kyle

    Scott Kyle September 1st, 2009 @ 04:39 PM

    No problem :-) This will be officially fixed in 2.0.

  • John-David Dalton

    John-David Dalton September 3rd, 2009 @ 06:29 PM

    I found the same article when researching this for FuseJS

    // the `Difference between MSXML2.XmlHttp and Microsoft.XmlHttp ProgIDs`
    // post explains why MSXML2.XmlHttp is not needed:
    // http://forums.asp.net/p/1000060/1622845.aspx
    

    Though I was not aware Microsoft.XMLHTTP was deprecated.
    Thanks for refreshing this issue.
    Very informative.

  • John-David Dalton

    John-David Dalton September 3rd, 2009 @ 06:52 PM

    More info on it confirming the deprecation straight from the horses mouth:
    http://blogs.msdn.com/xmlteam/archive/2006/10/23/using-the-right-version-of-msxml-in-internet-explorer.aspx

    * MSXML2 vs. Microsoft namespace -
    I’ve also seen a lot of code that instantiates the
    "Microsoft.XMLHTTP" ActiveX object rather than the MSXML2.XMLHTTP.3.0 or MSXML2.XMLHTTP.6.0 if you’re using 6.0.
    The "Microsoft" namespace is actually older and is only implemented in MSXML3 for legacy support.
    It’s unfortunate we used the "better" name on the older version, but stick to the "msxml2" namespace when instantiating objects.
    
  • lukasbuenger

    lukasbuenger September 4th, 2009 @ 09:49 AM

    Thank you for the information. In my opinion it is unfortunately still essential not to check only for the Microsoft namespace, because nobody knows when this legacy object is definitely going to vanish. Obviously it hasn't yet.

  • Thomas Aylott

    Thomas Aylott September 12th, 2009 @ 04:33 PM

    • State changed from “open” to “resolved”

    (from [f4cd9ea816509324ff7d8467ebd58fde8e59a3d0]) Fixes creating a Request in old versions of IE6. Fixes #739, see discussion there. http://github.com/mootools/mootools-core/commit/f4cd9ea816509324ff7...

  • Scott Kyle

    Scott Kyle October 19th, 2009 @ 09:50 PM

    • Milestone changed from 2.0 to 1.2.4

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket

Attachments

Referenced by

Pages