Ahhh... I see, that's pretty useful.
I think I would be inclined to use the following naming convention:
- copyEvents
- copyEventsTo
- cloneWithEvents
This way "clone" is always associated with cloning elements.
Additionally, adding in the "From" seems sort of redundant (it's not
used elsewhere in jQuery (.appendFrom?)
Finally, now that I see what your goal is, I think this would be an
interesting goal:
$("#foo").load("some.html",function(){
$(this).copyEvents( true, "#otherfoo" );
});
And this would do a deep traversal of the contents of #foo, attempting
to copy over events from similar elements in #otherfoo.
Of course, an ultimate goal would be:
$("a").click(...);
$("li").addClass("test");
$("#foo").liveLoad( "foo.html" );
and having all the a elements receive that particular event handler,
and all li elements receive a class of test.
Of course, the technical aspects behind this are quite daunting, but
it would certainly be a cool effect.
--John