//HTML:
<table id="requests" class="table table-striped multiselecttable">
<tbody>
<tr data-uid="209" style="cursor: pointer; ">
<td class="span5">Username</td>
<td>
<a class="btn btn-success"><i class="icon-ok icon-white"></i> Approve</a>
<a class="btn btn-inverse"><i class="icon-remove icon-white"></i> Reject</a>
</td>
</tr>
</tbody>
</table>
//查询:
if($("#requests").length) {
//individual request approve button
$("#requests .btn-inverse").click(function(e){
//works!
$(this).removeClass("btn-inverse").addClass("btn-danger").html("<i class='icon-white icon-remove'></i> Are you sure?");
});
$("#requests .btn-success").click(function(e){
//works!
e.stopPropagation();
});
$("#requests").on('click', '.btn-danger', function(e){
alert('why u no trigger (╯°□°)╯︵ ┻━┻');
e.stopPropagation();
});
}
当我点击 .btn-danger 时,什么都没有发生。其他两个功能(点击)正在工作。还有很多其他的javascript;有没有办法告诉我点击它时是否发生了什么?