Bug Tracker

Modify

Ticket #987 (closed bug: invalid)

Opened 6 years ago

Last modified 14 months ago

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:
Blocking: Blocked by:

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?

Change History

comment:1 Changed 6 years ago by john

  • need set to Review
  • Status changed from new to closed
  • Resolution set to invalid

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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.