Skip to main content

Bug Tracker

Side navigation

#11092 closed bug (invalid)

Opened December 21, 2011 02:10PM UTC

Closed January 05, 2012 08:02AM UTC

Last modified February 20, 2012 10:30AM UTC

"permission denied" jquery 1.7.1 IE7 on line 1666 accessing elem attribute

Reported by: paolo.savoldi.bs@gmail.com Owned by: paolo.savoldi.bs@gmail.com
Priority: low Milestone: None
Component: data Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:
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

}

Attachments (0)
Change History (6)

Changed December 21, 2011 03:15PM UTC by timmywil comment:1

component: unfileddata
owner: → paolo.savoldi.bs@gmail.com
priority: undecidedlow
status: newpending

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.

Changed January 05, 2012 08:02AM UTC by trac-o-bot comment:2

resolution: → invalid
status: pendingclosed

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!

Changed February 07, 2012 02:33PM UTC by me@tommytaylor.co.uk comment:3

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

Changed February 07, 2012 04:05PM UTC by me@tommytaylor.co.uk comment:4

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

Changed February 08, 2012 03:23PM UTC by timmywil comment:5

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.

Changed February 20, 2012 10:30AM UTC by l33 comment:6

I get this too when using an iframe and a different subdomain for performing ajax requests. What's the best way to debug this? It seems to be related to event handling, as it only happens when name is "events".