#8782 closed bug (wontfix)
.append() Bug
Reported by: | 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
Change History (4)
comment:1 Changed 11 years ago by
Component: | unfiled → event |
---|---|
Status: | new → open |
comment:2 Changed 11 years ago by
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 :)
comment:3 Changed 11 years ago by
Priority: | undecided → low |
---|---|
Resolution: | → wontfix |
Status: | open → closed |
jQuery cannot be responsible for the behaviour inline of event handlers.
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.