Opened 9 years ago
Closed 9 years ago
#14424 closed bug (wontfix)
ajax with isLocal=true flag in IE
Reported by: | Owned by: | dmethvin | |
---|---|---|---|
Priority: | low | Milestone: | 2.1 |
Component: | ajax | Version: | 2.0.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Hi,
I found a difference in behavior of jQuery 1.* and 2.* when trying to load resources locally using ajax in any version of IE. In 1.* it works fine. But in 2.* we got an error "Error: Access is denied." I have done some research and found that the reason is a lack of method createActiveXHR in 2.*. It is important for mobile app developers who uses Cordova and load templates locally.
I provide demo app:
- Download https://dl.dropboxusercontent.com/u/4466180/JqueryLocalAjax.zip
- Unzip it and open 'index.html' in IE.
- We will see error in console.
- After it replace jQuery 2.0.3 with 1.10.2.
- App works correctly.
I cannot provide it using jsFiddle because issue appears only when works with local files.
Change History (19)
comment:1 Changed 9 years ago by
Component: | unfiled → ajax |
---|---|
Priority: | undecided → low |
Status: | new → open |
comment:2 Changed 9 years ago by
Owner: | set to jaubourg |
---|---|
Status: | open → assigned |
comment:3 Changed 9 years ago by
Owner: | changed from jaubourg to dmethvin |
---|
comment:4 follow-up: 5 Changed 9 years ago by
I really hope that this bug gets fixed. I rely on a plugin that reads local json files.
comment:5 Changed 9 years ago by
Replying to anonymous:
I really hope that this bug gets fixed. I rely on a plugin that reads local json files.
I second this, I'm creating a manual for machines without internet access and would like to not have to send along a web server just to avoid local file requests.
comment:6 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Ajax: Fix #14424. Use ActiveX in IE9+ on local files, close gh-1434.
We can't feature detect ActiveX in IE11, but we can just call it and catch whatever error occurs, then try normal XHR.
Changeset: 498e0e6c9bf486a0b1f16b455d65fcbc6c43867e
comment:7 Changed 9 years ago by
Milestone: | None → 2.1 |
---|
comment:8 Changed 9 years ago by
I just tried the 2.1 beta http://code.jquery.com/jquery-2.1.0-beta2.js for this bug fix and it does not work.
Try it against the sample data provided in the zip of step 1 in the bug report.
comment:11 Changed 9 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
This is because the ActiveX xhr doesn't have the onload handler.
In other words, we would have to bring back 1.x src/ajax/xhr.js for this to work. I don't think it's worth it (this is clearly functionality deprecated by IE long time ago) but I'll let others chime in.
comment:12 Changed 9 years ago by
Status: | reopened → open |
---|
Oh duh, I didn't put two and two together. I agree that it's not worth redoing the 2.x ajax support for this but will leave the ticket open for now.
Note that Chrome already does not support local file access, so we've never been able to support local files in a cross-browser way on either 1.x or 2.x.
comment:13 Changed 9 years ago by
I really hope that you do not abandon this functionality in IE as it seems to me that there are at least 2 of us who need it. I'm not concerned about Chrome support or any other browser except IE.
comment:14 Changed 9 years ago by
Is there a problem with using jQuery 1.x in the meantime? We aren't dropping support for that any time soon.
comment:15 Changed 9 years ago by
Well I'm not sure. I was hoping to go with the 2.0 branch to try to keep the core more "lightweight" by not having all the older IE6, 7 and 8 support. My target browser is always going to be IE9+
comment:16 Changed 9 years ago by
Use 1.x and see if it works for you. If so your problem is solved. We're not going to add a bunch of code to 2.0 for a special case like this specifically because we're trying to keep it lightweight.
comment:17 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | open → closed |
Revert "Ajax: Fix #14424. Use ActiveX in IE9+ on local files, close gh-1434."
This reverts commit 498e0e6c9bf486a0b1f16b455d65fcbc6c43867e.
We can't use the ActiveX XHR because it doesn't support events.
Changeset: b278d8174f307fd351ae9ce6409c1806e7426e34
comment:18 Changed 9 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:19 Changed 9 years ago by
Resolution: | → wontfix |
---|---|
Status: | reopened → closed |
Use 1.x for this edge case.
Related to #14475 but not quite the same. As a workaround until it's fixed, you can pass in an
xhr
function.