I have a function that uses the deprecated live() function, but no matter what I try, I cannot seem to get on() to duplicate the functionality.
Here’s the working live() code:
$("#video_url").live("paste", function(){
Here’s the on() code that should be working:
$(".post-modal").on("paste", "#video_url", function(){
.post-modal is the immediate parent of #video_url.
Any ideas?
try
make sure the element to which you are delegating the event exists in the DOM like in your code element with class
.post-modalshould be at a higher level then the element with the idvideo-urland also present in the DOM at the time when the events are attached to the elements