Skip to main content

Bug Tracker

Side navigation

#5935 closed bug (invalid)

Opened January 26, 2010 10:16AM UTC

Closed January 29, 2010 03:20AM UTC

Attached events is lost on empty()

Reported by: petter@infotjenester Owned by:
Priority: trivial Milestone:
Component: core Version: 1.4
Keywords: eventhandling empty Cc:
Blocked by: Blocking:
Description

This might not be a bug, but i'm filing it here anyway...

$("selector").click(doSomething);

works fine ofcours..

But if I take an element that has this event attached, moves and does

$("#someElement").append(someElementWithClick);

the click event still works on both elements.

But if I do

$("#someElement").empty();

the click event is removed from the original element..

The problem is solved by adding a .clone()

$("#someElement").append(someElementWithClick.clone());

So I'm not sure if this is a bug or a feature.. :)

Attachments (0)
Change History (1)

Changed January 29, 2010 03:20AM UTC by dmethvin comment:1

resolution: → invalid
status: newclosed

Can you put together a complete test case and reopen with an attachment? Thanks!