Bug Tracker

Opened 6 years ago

Closed 6 years ago

#14335 closed bug (invalid)

Uncaught TypeError: Object #<HTMLDocument> has no method 'getAttribute'

Reported by: patrixd@… Owned by: patrixd@…
Priority: undecided Milestone: None
Component: unfiled Version: 2.0.3
Keywords: Cc:
Blocked by: Blocking:

Description

The error is in the next line ( return elem.getAttribute("id") === attrId ):

Expr.filter["ID"] = function (id) {
                    var attrId = id.replace(runescape, funescape);
                    return function (elem) {
                        return elem.getAttribute("id") === attrId;
                    };
                };

When elem is the document. It happens to me in a really special momment.

I have a listener in a menu, when the user clicks it, it hides the container where it is located in and shows a new section div with a new similar menu. After hide the current section that contains the menu and after show the new section, the event is bubbling up in the divs of the div.section with display:none. When it finds event handlers inside the invisible div, it fails with the first event (click #id1). If I remove that handler, I get the same error but with the #id2 (second event) instead.

I tried to change the code and evaluate if elem is document, and the error does not occur anymore, the application works perfectly.

I can't show you an example because I use backbonejs for the events. They works fine always, but the problem is when it evaluates the events of a early hidden container in a bubbling event.

I hope I explained well, thank you so much in advance.

Change History (2)

comment:1 Changed 6 years ago by dmethvin

Owner: set to patrixd@…
Status: newpending

Hi, can you provide a test case that demonstrates the problem, using jsfiddle.net? Thanks!

comment:2 Changed 6 years ago by trac-o-bot

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!

Note: See TracTickets for help on using tickets.