Bug Tracker

Opened 15 years ago

Closed 15 years ago

Last modified 10 years ago

#987 closed bug (invalid)

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:


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?

Change History (1)

comment:1 Changed 15 years ago by john

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.

Note: See TracTickets for help on using tickets.