Bug Tracker

Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#13208 closed bug (fixed)

JS error trying to get the id of the document in IE8

Reported by: tj.vantoll Owned by: gibson042
Priority: undecided Milestone: 1.9.1
Component: event Version: git
Keywords: Cc:
Blocked by: Blocking:


See http://jsfiddle.net/tj_vantoll/tg2VU/ and click on the link in IE8.

I get a JS error from this block in Sizzle:

Expr.filter["ID"] = function( id ) {
	var attrId = id.replace( runescape, funescape );
	return function( elem ) {
		//The error occurs here when trying to call getAttribute
                //on the document itself
		return elem.getAttribute("id") === attrId;

Couple of things:

  • There needs to be an id listener attached to the document. It doesn't need to do anything, but it must be there.
  • This seems specific to tables, if I switch the <table> with a <div> the problem does not occur.
  • The issue does not occur in IE7, IE9, or the latest Chrome and Firefox. It seems specific to IE8.

I was unable to debug this any deeper on my own.


Change History (11)

comment:1 Changed 11 years ago by gibson042

Resolution: worksforme
Status: newclosed

I am unable to reproduce on jquery-1.8.3 or jquery-git with IE7 or IE8. Please let us know if you continue to observe this behavior.

comment:2 Changed 11 years ago by gibson042

Component: unfiledevent

comment:3 Changed 11 years ago by tj.vantoll

It's an IE8 only issue. I see it on http://jsfiddle.net/tj_vantoll/tg2VU/show in both a real IE8 install as well as IE8 via BrowserStack.

The link is successfully removed but I do get a JS error.

comment:4 Changed 11 years ago by gibson042

Resolution: worksforme
Status: closedreopened

Ah, I see now. Removing the ancestor element makes its parent a DocumentFragment for further event processing, which is invalid input for Sizzle. Sneaky.

comment:5 Changed 11 years ago by gibson042

Owner: set to gibson042
Status: reopenedassigned

comment:6 Changed 11 years ago by mikesherov

Tsk tsk. You should know better than to challenge the king of all triagers: tj.vantoll. :)

comment:7 Changed 11 years ago by Richard Gibson

Resolution: fixed
Status: assignedclosed

Fix #13208: only check elements for delegation matches

Changeset: fc2ba2e1361126c39f955437ee025cfca3bffa65

comment:8 Changed 11 years ago by gibson042

Milestone: None1.9.1

comment:9 Changed 10 years ago by dcherman

This seems like it may still be an issue in the 2.X branch. Here's a repro case ( tested in Chrome Latest ):


comment:10 Changed 10 years ago by dmethvin

dcherman can you open a new ticket? Tagging onto old tickets is not good, even if it might be the same problem. Thanks!

comment:11 Changed 10 years ago by navjot.singh@…

I am having the same problem. Can you tell the solution to this problem ?

Note: See TracTickets for help on using tickets.