ajax - jquery selector click not firing from dynamically generated button? -


the following button generated ajax success call (there many of them):

<a class="btn appdetails" href="#mymodal" data-toggle="modal" role="button">' + data.application_name + '</a> 

i've tried of following , none of them seem fire:

$('.appdetails').click(function () {     alert("test"); });  $('.appdetails').live("click", function () {     alert("test"); });  $('.appdetails').on("click", function () {     alert("test"); });  $('document').on("click",".appdetails", function () {     alert("test"); }); 

probably missing stupid... note clicking on link does open bootstrap modal properly. not sure if conflicts, wouldn't think so...

you need way

$(document).on("click",".appdetails", function () {     alert("test"); }); 

Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -