Skip to main content

Bug Tracker

Side navigation

#14424 closed bug (wontfix)

Opened October 07, 2013 12:33PM UTC

Closed December 16, 2013 05:02PM UTC

ajax with isLocal=true flag in IE

Reported by: alexander.bulychev@devexpress.com 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.

Attachments (0)
Change History (19)

Changed October 21, 2013 03:31PM UTC by dmethvin comment:1

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.

Changed October 21, 2013 04:10PM UTC by dmethvin comment:2

owner: → jaubourg
status: openassigned

Changed November 11, 2013 05:13PM UTC by dmethvin comment:3

owner: jaubourgdmethvin

Changed November 13, 2013 03:37AM UTC by anonymous comment:4

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

Changed November 14, 2013 06:27PM UTC by anonymous comment:5

Replying to [comment:4 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.

Changed November 14, 2013 08:29PM UTC by Dave Methvin comment:6

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

Changed November 14, 2013 08:32PM UTC by dmethvin comment:7

milestone: None2.1

Changed November 16, 2013 01:45PM UTC by anonymous comment:8

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.

Changed November 27, 2013 12:39PM UTC by anonymous comment:9

can anyone confirm the comment above?

Changed November 28, 2013 09:07AM UTC by m_gol comment:10

#14554 is a duplicate of this ticket.

Changed November 28, 2013 09:07AM UTC by m_gol comment:11

_comment0: 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.1385629732410432
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 (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.

Changed November 28, 2013 02:02PM UTC by dmethvin comment:12

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.

Changed November 28, 2013 06:42PM UTC by anonymous comment:13

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.

Changed November 28, 2013 06:43PM UTC by dmethvin comment:14

Is there a problem with using jQuery 1.x in the meantime? We aren't dropping support for that any time soon.

Changed November 28, 2013 07:15PM UTC by anonymous comment:15

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+

Changed November 28, 2013 07:21PM UTC by dmethvin comment:16

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.

Changed December 16, 2013 04:47PM UTC by Dave Methvin comment:17

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

Changed December 16, 2013 05:02PM UTC by dmethvin comment:18

resolution: fixed
status: closedreopened

Changed December 16, 2013 05:02PM UTC by dmethvin comment:19

resolution: → wontfix
status: reopenedclosed

Use 1.x for this edge case.