css - jQuery tmpl plugin - problems with template results from dynamic content (bug?) -


i've use jquery templates (http://api.jquery.com/jquery.tmpl/) render lists on pages based on remote content, working well, when apply class content , have click event class dynamic template content doesn't respect action hard coded content works fine.

i've edited basic demo ships tmpl plugin add static list proof of concept: http://jsfiddle.net/3evrr/2/

clicking static 'bar' link generates alert i'd expect. clicking of buttons (cartoons or drama) generate list clicking hyperlink (it has same class hard coded link) not fire alert.

can see problem is? firebug not show errors, on inspection classes both static , dynamic content same.

thanks

as aleksv pointed out, traditional .click() handlers apply elements can selected when handler initialized. in case, .live() (or .delegate()) handler better approach:

// handler apply .getpage element, if created //  after handler declaration has been executed. $('.getpage').live('click', function(){     alert('clicked element getpage class'); }); 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -