Skip to main content

Bug Tracker

Side navigation

#9560 closed bug (cantfix)

Opened June 10, 2011 08:20PM UTC

Closed September 23, 2011 05:50PM UTC

Last modified November 05, 2013 02:39PM UTC

Null function getAttribute is invoked in acceptData()

Reported by: anonymous Owned by: rwaldron
Priority: blocker Milestone: 1.7
Component: manipulation Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:
Description

Sorry for the cryptic summary, but this problem is hard to succinctly define. Basically, I'm getting an error inside of jQuery's acceptData method; the getAttribute function, which is null, is being invoked on an object (an HTMLObjectElement). This is ultimately triggered by my application's calling of 'remove' on an element. Here's the simplified call stack:

remove
-> cleanData (in jquery-ui)
   -> triggerHandler('remove')
      -> trigger('remove', ...)
         -> var m = f._data(k, 'handle')
            -> return f.data(a, 'data', c, !0)
               -> if (!!acceptData(a))
                  -> a.getAttribute('classid') (getAttribute is null)

This error is occurring in IE 9. I have no idea what is causing getAttribute to be null on what looks like a DOM object. The object is an HTML "object" object that happens to be some embedded Flash created through SWFObject. Perhaps jQuery can add some defensive code so that if getAttribute is null, acceptData won't cause this error.

Attachments (0)
Change History (11)

Changed June 11, 2011 02:35AM UTC by dmethvin comment:1

owner: → anonymous
status: newpending

I can see how this might happen, an <object> tag is often a manifestation of a non-Javascript host object and doesn't play by the rules.

However, we could really use a test case, and can't work on a fix until we get one.

Also, the workaround will most likely be to ban use of .data() on the element so whatever code was trying to get/set data won't be able to do that. Alternatively we could allow use of .data() if we can determine it's safe to use for this particular case.

Changed June 11, 2011 09:22PM UTC by davidalism comment:2

I had this exact problem in my application. My fix was that getAttribute was triggered from my jQuery draggable plugin, and so I just return if the element's tagname is object. This does not seem like something jQuery should fix, but it is the developer's responsibility to make sure that we call native JavaScript methods only on DOM elements that implement the methods.

Changed June 26, 2011 07:56AM UTC by trac-o-bot comment:3

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 August 09, 2011 11:17AM UTC by francesco.puglisi@femory.de comment:4

update: using some templating libraries (I have tested this issue with David Pirek's JQuery MVC, http://www.davidpirek.com/javascript-mvc-jquery-plugin-framework), it is likely that the invocation of the .data() function doesn't fall directly under the developer's control.

http://jsfiddle.net/airspeed/9TLZx/11/

Changed August 10, 2011 02:01PM UTC by anonymous comment:5

I am seeing this issue a well. Occurs when you try to remove DOM element that contains Flash movie.

Changed August 10, 2011 02:20PM UTC by rwaldron comment:6

resolution: invalid
status: closedreopened

Changed August 10, 2011 02:20PM UTC by rwaldron comment:7

_comment0: → 1312986044716464
component: unfiledmanipulation
owner: anonymousrwaldron
priority: undecidedlow
status: reopenedassigned

Reopening for review

Changed September 23, 2011 05:08PM UTC by rwaldron comment:8

milestone: 1.next1.7
priority: lowblocker

Changed September 23, 2011 05:50PM UTC by rwaldron comment:9

resolution: → cantfix
status: assignedclosed

Changed November 05, 2013 02:24PM UTC by anonymous comment:10

This is still an issue with 1.10.2 using uploadify. The uploadify object has a nodeName of 'OBJECT' and the jQuery noData function on it returns a classid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000". However, the getAttribute function of the elem is null. It's simple enough to fix by just trapping for a null getAttribute function thus:

return (elem.getAttribute === true ? false : (!noData || noData !== true && elem.getAttribute("classid") === noData));

Changed November 05, 2013 02:39PM UTC by dmethvin comment:11

Please report to the uploadify folks.