jQuery live to on, with $(this) -


i'm updating scripts working in jquery 1.9+

live removed , have convert on syntax. there examples on jquery documentation. documentation gives:

$(selector).live(events, data, handler); // jquery 1.3+ $(document).on(events, selector, data, handler); // jquery 1.7 

so $("a").live("click", handler) schould converted $(document).on("click","a", handler) , on.

but how convert when have no selector? in case inside plugin.

$(this).live("click", handler) 

this not working:

$(document).on("click",$(this), handler)  

--edit

i need delegation, bind not solution. used inside plugin, code

elem.live("click", handler), elem selector, , $(this). have no control on that.

just use

$(this).on("click", handler); 

or

$(this).click(handler); 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -