#9560 closed bug (cantfix)
Null function getAttribute is invoked in acceptData()
Reported by: | anonymous | Owned by: | Rick Waldron |
---|---|---|---|
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.
Change History (11)
comment:1 Changed 12 years ago by
Owner: | set to anonymous |
---|---|
Status: | new → pending |
comment:2 Changed 12 years ago by
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.
comment:3 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
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!
comment:4 Changed 11 years ago by
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/
comment:5 Changed 11 years ago by
I am seeing this issue a well. Occurs when you try to remove DOM element that contains Flash movie.
comment:6 Changed 11 years ago by
Resolution: | invalid |
---|---|
Status: | closed → reopened |
comment:7 Changed 11 years ago by
Component: | unfiled → manipulation |
---|---|
Owner: | changed from anonymous to Rick Waldron |
Priority: | undecided → low |
Status: | reopened → assigned |
Reopening for review
comment:8 Changed 11 years ago by
Milestone: | 1.next → 1.7 |
---|---|
Priority: | low → blocker |
comment:9 Changed 11 years ago by
Resolution: | → cantfix |
---|---|
Status: | assigned → closed |
comment:10 Changed 9 years ago by
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:
noData !== true && elem.getAttribute("classid") === noData)); |
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.