Bug Tracker

Modify

Ticket #3623 (closed bug: fixed)

Opened 5 years ago

Last modified 3 years ago

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

Description

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

comment:1 Changed 5 years ago by flesler

  • Cc Irfan added
  • Owner set to flesler
  • Status changed from new to assigned

Ok, we'll look into it asap.

comment:2 Changed 4 years ago by matthewk

What's happening with this?

comment:3 Changed 4 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 4 years ago by trixi

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

comment:5 Changed 3 years ago by dmethvin

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

comment:6 Changed 3 years ago by dmethvin

  • Summary changed from ajaxOptions.xhr breaks if IE activex disabled to ajaxSettings.xhr breaks if IE activex disabled

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

comment:7 Changed 3 years ago by john

  • Status changed from assigned to closed
  • Version changed from 1.2.6 to 1.4a2
  • Resolution set to fixed
  • Milestone changed from 1.3 to 1.4

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.