Bug Tracker

Opened 14 years ago

Closed 13 years ago

#3623 closed bug (fixed)

ajaxSettings.xhr breaks if IE activex disabled

Reported by: Irfan Owned by: flesler
Priority: major Milestone: 1.4
Component: ajax Version: 1.4a2
Keywords: Cc: Irfan
Blocked by: Blocking:


Ajax does not work on IE7 ActiveX are disabled.

Following is the XHR instantiation code in JQuery.

var xhr = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();

The check window.ActiveXObject returns non-null and non-undefined on IE7 even if activeX are disabled. However, the instantiation (new ActiveXObject("Microsoft.XMLHTTP")) throws an error. The code does not even use IE7's native XMLHttpRequest as a fallback.

This should be changed to something like:

var xhr;

try {

xhr = new ActiveXObject("Microsoft.XMLHTTP"); IE with ActiveX enabled

} catch(ex) {

xhr = new XMLHttpRequest(); IE7+ with ActiveX disabled and Non-IE


Steps to reproduce:

  1. Disable ActiveX on IE7

(To disable ActiveX go to Tools -> Internet Options -> Security -> Internet/Intranet -> Custom Level -> Run ActiveX controls and plugins -> Disable.)

  1. Try sending an Ajax Request.

Observed: JS error

Expected: JQuery should use the native XMLHttpRequest.

Versions: 1.2 to 1.2.6

Change History (7)

comment:1 Changed 14 years ago by flesler

Cc: Irfan added
Owner: set to flesler
Status: newassigned

Ok, we'll look into it asap.

comment:2 Changed 14 years ago by matthewk

What's happening with this?

comment:3 Changed 13 years ago by dmurrell

We experienced this today. A user had installed the latest version of IE7 (7.0.573.13) and now experienced this issue. In reviewing the security settings ActiveX was enabled. Internet zone was set to Medium-High.

We assumed this was caused by some non-obvious change in the enforcement of ActiveX security.

The change suggested solved the issue and is consistent with the Ajax transport handling in the Prototype library.

comment:4 Changed 13 years ago by trixi

Information wether ajax is supported by the client should be avialable via jQuery.support.ajax

comment:5 Changed 13 years ago by dmethvin

Summary: Ajax does not work on IE7 if activex are disabled (jQuery does not fallback to use IE7's native XMLHttpRequest).ajaxOptions.xhr breaks if IE activex disabled

comment:6 Changed 13 years ago by dmethvin

Summary: ajaxOptions.xhr breaks if IE activex disabledajaxSettings.xhr breaks if IE activex disabled

See related tickets #2849, #5338, #5529, when fixing this.

comment:7 Changed 13 years ago by john

Milestone: 1.31.4
Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.