Bug Tracker

Opened 11 years ago

Closed 11 years ago

#6536 closed bug (worksforme)

empty() triggers 'remove: java.lang.NoSuchFieldException' upon removing <object> element with applet

Reported by: ArthurSAM Owned by:
Priority: Milestone: 1.4.3
Component: core Version: 1.3.2
Keywords: applet, object, remove, internet explorer Cc:
Blocked by: Blocking:


A customer of ours is using jquery-1.3.2 and was experiencing problems in IE8 with our applet. They have a dialog (div) containing an object element with our applet. They then perform a dynamic load for the dialog (div) using the jquery .load() call. At some point this results in a call to .empty() right before the newly fetched html is inserted/appended. The .empty() call somewhere down the line results in trigger(..) being called with 'remove' event and the object element (that contains our applet) as elem parameter. This raises the javascript error:

java.lang.NoSuchFieldException: remove in class: <AppletClassName>

This happens on the following line:

Handle triggering native .onfoo handlers (and on links since we don't call .click() for links)

if ( (!elem[type]
(jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false )

event.result = false;

To be exact: 'elem[type]' is the problem. Type is 'remove' in this case and IE8 sees elem as the applet and tries to retrieve a field named 'remove' from the applet. This of course doesn't exist.

I'm not familiar with jquery and what's supposed to happen here but jquery should never try to access fields of the actual applet. If IE does not distinguish between the object element and the applet you should probably skip this code for object elements containing Java applets.

Change History (1)

comment:1 Changed 11 years ago by john

Resolution: worksforme
Status: newclosed

This issue was fixed in jQuery 1.4.

Note: See TracTickets for help on using tickets.