#6484 closed bug (fixed)
data attribute overwrited in new node creation
Reported by: | naugtur | Owned by: | naugtur |
---|---|---|---|
Priority: | undecided | Milestone: | 1.4.3 |
Component: | data | Version: | 1.4.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
found here: http://stackoverflow.com/questions/2713542/bug-in-jquerys-element-creation
$(document).ready(function(){
var fun=function(){
alert('fired');
};
var parms={
'id': 'sth', 'text': 'click', 'click':fun, 'data': {
'somedata': 'somedata'
} };
var _new_li = $('<li/>',parms);
_new_li.appendTo($("body")); });
After clicking on the li element error is thrown
e is undefined in jquery line 1919
var events = jQuery.data(this, "events"), handlers = events[ event.type ];
events is undefined.
jquery overwrites events stored in data.
It probably should extend.
Change History (4)
comment:1 Changed 13 years ago by
Owner: | set to naugtur |
---|---|
Priority: | → undecided |
Status: | new → pending |
comment:2 Changed 13 years ago by
Keywords: | needsreview added; creation data overwrite removed |
---|
comment:3 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | pending → closed |
Fixed in 1.4.3, with this commit: https://github.com/jquery/jquery/commit/0b4b3ee8a5eda75d8399b333cda54f6b319fe74c
comment:4 Changed 13 years ago by
Keywords: | needsreview removed |
---|
Please provide a reduced jsFiddle test case, thanks!
Additionally, test against the jQuery 0 GIT version to ensure the issue still exists.