Skip to main content

Bug Tracker

Side navigation

#14335 closed bug (invalid)

Opened September 05, 2013 10:15AM UTC

Closed September 20, 2013 08:44AM UTC

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

Reported by: patrixd@gmail.com Owned by: patrixd@gmail.com
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.

Attachments (0)
Change History (2)

Changed September 05, 2013 12:47PM UTC by dmethvin comment:1

owner: → patrixd@gmail.com
status: newpending

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

Changed September 20, 2013 08:44AM 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!