Possible Duplicate:
jquery: on vs live
I have code that works just fine using $('thing').live("mousemove", function(e) {
and $('thing').live({mouseenter:function(e) {
. I notice jquery said live
is depreciated and to use on
so i did. However it doesn't seem to work the way i expect it to. I had mousemove events but since objects were loaded dynamically the events werent triggering which is why i use live. Now live works perfectly but when i use on
as jquery suggested it seems to act like .mousemove and such. It works on objects that exist when the code is executed and not on dynamically added events (the whole reason i use live).
Is there a way to tell on to act like live and add events on new object? or do i use live?