Bug Tracker

Opened 9 years ago

Closed 9 years ago

#14424 closed bug (wontfix)

ajax with isLocal=true flag in IE

Reported by: [email protected] 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:

  1. Download https://dl.dropboxusercontent.com/u/4466180/JqueryLocalAjax.zip
  2. Unzip it and open 'index.html' in IE.
  3. We will see error in console.
  4. After it replace jQuery 2.0.3 with 1.10.2.
  5. 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 dmethvin

Component: unfiledajax
Priority: undecidedlow
Status: newopen

Related to #14475 but not quite the same. As a workaround until it's fixed, you can pass in an xhr function.

comment:2 Changed 9 years ago by dmethvin

Owner: set to jaubourg
Status: openassigned

comment:3 Changed 9 years ago by dmethvin

Owner: changed from jaubourg to dmethvin

comment:4 Changed 9 years ago by anonymous

I really hope that this bug gets fixed. I rely on a plugin that reads local json files.

comment:5 in reply to:  4 Changed 9 years ago by anonymous

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 Dave Methvin

Resolution: fixed
Status: assignedclosed

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 dmethvin

Milestone: None2.1

comment:8 Changed 9 years ago by anonymous

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:9 Changed 9 years ago by anonymous

can anyone confirm the comment above?

comment:10 Changed 9 years ago by m_gol

#14554 is a duplicate of this ticket.

comment:11 Changed 9 years ago by m_gol

Resolution: fixed
Status: closedreopened

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.

Version 0, edited 9 years ago by m_gol (next)

comment:12 Changed 9 years ago by dmethvin

Status: reopenedopen

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 anonymous

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 dmethvin

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 anonymous

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 dmethvin

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 Dave Methvin

Resolution: fixed
Status: openclosed

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 dmethvin

Resolution: fixed
Status: closedreopened

comment:19 Changed 9 years ago by dmethvin

Resolution: wontfix
Status: reopenedclosed

Use 1.x for this edge case.

Note: See TracTickets for help on using tickets.