Bug Tracker

Ticket #14424 (closed bug: wontfix)

Opened 15 months ago

Last modified 12 months ago

ajax with isLocal=true flag in IE

Reported by: alexander.bulychev@… Owned by: dmethvin
Priority: low Milestone: 2.1
Component: ajax Version: 2.0.3
Keywords: Cc:
Blocking: Blocked by:

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

comment:1 Changed 14 months ago by dmethvin

  • Priority changed from undecided to low
  • Status changed from new to open
  • Component changed from unfiled to ajax

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 14 months ago by dmethvin

  • Owner set to jaubourg
  • Status changed from open to assigned

comment:3 Changed 13 months ago by dmethvin

  • Owner changed from jaubourg to dmethvin

comment:4 follow-up: ↓ 5 Changed 13 months 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 13 months 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 13 months ago by Dave Methvin

  • Status changed from assigned to closed
  • Resolution set to fixed

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 13 months ago by dmethvin

  • Milestone changed from None to 2.1

comment:8 Changed 13 months 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 13 months ago by anonymous

can anyone confirm the comment above?

comment:10 Changed 13 months ago by m_gol

#14554 is a duplicate of this ticket.

comment:11 Changed 13 months ago by m_gol

  • Status changed from closed to reopened
  • Resolution fixed deleted

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 (maybe without some workarounds for older IEs). 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.

Last edited 13 months ago by m_gol (previous) (diff)

comment:12 Changed 13 months ago by dmethvin

  • Status changed from reopened to 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 13 months 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 13 months 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 13 months 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 13 months 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 12 months ago by Dave Methvin

  • Status changed from open to closed
  • Resolution set to fixed

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 12 months ago by dmethvin

  • Status changed from closed to reopened
  • Resolution fixed deleted

comment:19 Changed 12 months ago by dmethvin

  • Status changed from reopened to closed
  • Resolution set to wontfix

Use 1.x for this edge case.

Note: See TracTickets for help on using tickets.