Skip to main content

Bug Tracker

Side navigation

#8782 closed bug (wontfix)

Opened April 06, 2011 06:37AM UTC

Closed July 12, 2011 03:15PM UTC

Last modified July 12, 2011 03:27PM UTC

.append() Bug

Reported by: max2000pn@yahoo.it Owned by:
Priority: low Milestone: 1.next
Component: event Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:
Description

I have found this bug working with Firefox 3.6 and 4 using jquery 1.4 or 1.5:

<div id="cont"></div>

<script>

$('#cont').append('<img onload=alert("test") src=img/abc.jpg >');

</script>

When I append the image the onload event fires twice. I had not this problem with jquery 1.3

thanks in advance

Massimo

Attachments (0)
Change History (4)

Changed April 06, 2011 02:39PM UTC by timmywil comment:1

component: unfiledevent
status: newopen

Thank you for submitting a bug report to the jQuery project.

In the future, please do not paste code in the ticket, but provide a test case on http://jsfiddle.net.

http://jsfiddle.net/timmywil/ERt2z/ It seems the inline event handler does get called twice.

Changed April 19, 2011 11:48PM UTC by editor@fiveminuteargument.com comment:2

Having looked into this, I've narrowed this down to the call to clone that occurs in domManip around line 5362. I have no idea what the full implications of that call are, but - for example - hard-coding results.cacheable to false just before that call cancels the 'double event'. Hoping that's of some help to one of you who knows what you're doing :)

Changed July 12, 2011 03:15PM UTC by rwaldron comment:3

priority: undecidedlow
resolution: → wontfix
status: openclosed

jQuery cannot be responsible for the behaviour inline of event handlers.

Changed July 12, 2011 03:27PM UTC by rwaldron comment:4