Ticket #12560 (closed bug: notabug)
jQuery's detach is calling Prototype's remove, even in noConflict mode
| Reported by: | mageluingil@… | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | None |
| Component: | unfiled | Version: | 1.8.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
When an animation, using jQuery's detach function for the callback, is queued on an element twice, the detach function fails, and tries to run Prototype's remove function, which throws an error.
Demonstration: http://jsfiddle.net/67MfS/3/ Click the show/hide button, then click it again while the fadeOut animation is running. The console will show "TypeError: element.parentNode is null" in prototype.js.
I'm not sure if the problem is occurring when the callback is called, or when the second fadeOut attempts to run on the already detached element (though the element does not appear to be detaching). In either case, however, the prototype function should *not* be trying to run. jQuery usually fails much more gracefully when it cannot find the matching element.
Tested using Prototype 1.7 and both jQuery 1.7.1 and 1.8.1, in Firefox 15, Chrome 21, and IE7-IE9. (Both Windows and Linux for FF and Chrome) The behavior does *not* appear in IE8, for whatever reason.
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

The .fadeOut method calls the callback once for each element animated, with this set to the DOM element not the jQuery object.