Skip to main content

Bug Tracker

Side navigation

#987 closed bug (invalid)

Opened February 21, 2007 11:39AM UTC

Closed April 28, 2007 03:50PM UTC

Last modified March 15, 2012 05:58PM UTC

IE (below 7) always uses POST (XMLHttpRequest simplified too much)

Reported by: see Owned by:
Priority: minor Milestone: 1.1.3
Component: ajax Version: 1.1.1
Keywords: Cc:
Blocked by: Blocking:
Description

It seems the function which defines XMLHttpRequest for IE has regressed and does not work as expected in all environments. Before 1.1.1 (I have not checked all versions but at least in 1.02) the following implementation was used:

XMLHttpRequest = function(){
		return new ActiveXObject(
			navigator.userAgent.indexOf("MSIE 5") >= 0 ?
			"Microsoft.XMLHTTP" : "Msxml2.XMLHTTP"
		);
	};

The implementation in 1.1.1 is simplified (IMHO too much):

XMLHttpRequest = function(){
		return new ActiveXObject("Microsoft.XMLHTTP");
	};

A bug occurs using XMLHTTPRequest in IE 5.5 or 6 (I have http://tredosoft.com/Multiple_IEMultipleIE installed).

IE always uses POST in this case, which is only noticable if e.g. a the Ajax servlet implements GET only or uses a different implementation for GET and POST. So quite hard to track, I only found the problem using http://www.fiddlertool.com which tracks all HTTP traffic.

A proposed solution is:

XMLHttpRequest = function(){
		// version depends on ms msversion NOT browser version
		// wrong version sends always POST!
		try {
			return new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			return new ActiveXObject("Microsoft.XMLHTTP");
			} 

Maybe the original implementor would like to look into that?

Attachments (0)
Change History (1)

Changed April 28, 2007 03:50PM UTC by john comment:1

need: → Review
resolution: → invalid
status: newclosed

This may be the case in IE 5.5 but it's not in IE 6. Since IE 5.5 isn't supported, the current solution is adequate.