Ticket #11092 (closed bug: invalid)
"permission denied" jquery 1.7.1 IE7 on line 1666 accessing elem attribute
| Reported by: | paolo.savoldi.bs@… | Owned by: | paolo.savoldi.bs@… |
|---|---|---|---|
| Priority: | low | Milestone: | None |
| Component: | data | Version: | 1.7.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
It happens with IE7 (IEtester v. 0.4.8) at this line
id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey
when accessing elem[internalKey].
It seems no elem property is accessible. I detected the error happening when elem is the whole DOMWindow object containing many functions and ajax calls but I wasn't able to isolate the problem. Every other elem in the page doesn't seem to raise exceptions. I added the following workaround to the jquery code
var privateCache, thisCache, ret,
internalKey = jQuery.expando, getByName = typeof name === "string",
We have to handle DOM nodes and JS objects differently because IE6-7 can't GC object references properly across the DOM-JS boundary isNode = elem.nodeType,
Only DOM nodes need the global jQuery cache; JS object data is attached directly to the object so GC can occur automatically cache = isNode ? jQuery.cache : elem,
Only defining an ID for JS objects if its cache already exists allows the code to shortcut on the same path as a DOM node with no cache id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey, isEvents = name === "events";
try {
var id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
} catch(e) {
do nothing
}
Change History
comment:1 Changed 17 months ago by timmywil
- Owner set to paolo.savoldi.bs@…
- Priority changed from undecided to low
- Status changed from new to pending
- Component changed from unfiled to data
comment:2 Changed 17 months ago by trac-o-bot
- Status changed from pending to closed
- Resolution set to invalid
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
comment:3 Changed 16 months ago by me@…
Hi
I currently have the same issue with jQuery v1.7.1 and even 1.7.2 beta 2!
I get a permission denied error when trying to submit a form using jQuery for line 1703
id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey,
Reverting back to jQuery v.1.6.4 seems to work for now
Thanks
Tom Taylor
comment:4 Changed 16 months ago by me@…
Hi again!
Created a try catch around the permission denied issue for IE7, and set the id and isEvents vars to false by default
If anyone wants to try this for now this will help with the issue within jQuery v1.7.1+ (including v1.7.2 beta 2)
var privateCache, thisCache, ret,
internalKey = jQuery.expando,
getByName = typeof name === "string",
id = isEvents = false,
// We have to handle DOM nodes and JS objects differently because IE6-7
// can't GC object references properly across the DOM-JS boundary
isNode = elem.nodeType,
// Only DOM nodes need the global jQuery cache; JS object data is
// attached directly to the object so GC can occur automatically
cache = isNode ? jQuery.cache : elem;
// Only defining an ID for JS objects if its cache already exists allows
// the code to shortcut on the same path as a DOM node with no cache
try {
id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
isEvents = name !== undefined ? (name === "events") : isEvents;
} catch(e) {
}
Would be great if this could be fixed for the next release!
Tom Taylor
comment:5 Changed 16 months ago by timmywil
Inserting try/catch is not really an option. It inhibits debugging and hides the actual problem. I don't see a reason to reopen this ticket until we have a small test case that can reproduce the issue, but I'd be willing to investigate further once we do have a test case.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.
Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/. Open the link and click to "Fork" (in the top menu) to get started.