jQuery trigger not firing with bind() or on() for custom events
问题 Can anyone tell me why this code would not be working? $('body').on('test', function() { alert('test'); }); $('body').trigger('test'); I'm using jquery-1.7.2.min . I do not get any errors, just nothing happens. I've tried putting the code inside an inline script, inside a $(document).ready() and still nothing. I've also tried both on() and bind() and neither result. I see examples all over showing the same syntax, so what is different with this? 回答1: It appears the issue lies in the DOM being