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: |
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:
- Disable ActiveX on IE7
(To disable ActiveX go to Tools -> Internet Options -> Security -> Internet/Intranet -> Custom Level -> Run ActiveX controls and plugins -> Disable.)
- 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
Cc: | Irfan added |
---|---|
Owner: | set to flesler |
Status: | new → assigned |
comment:3 Changed 13 years ago by
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
Information wether ajax is supported by the client should be avialable via jQuery.support.ajax
comment:5 Changed 13 years ago by
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
Summary: | ajaxOptions.xhr breaks if IE activex disabled → ajaxSettings.xhr breaks if IE activex disabled |
---|
comment:7 Changed 13 years ago by
Milestone: | 1.3 → 1.4 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Version: | 1.2.6 → 1.4a2 |
Ok, we'll look into it asap.