jquery click doesn’t work on ajax generated content

Should be done this way. $(‘body’).on(‘click’, ‘.button’, function (){ alert(‘click!’); }); If you have a container that doesn’t change during the ajax request, this is more performant: $(‘.container’).on(‘click’, ‘.button’, function (){ alert(‘click!’); }); Always bind the delegate event to the closest static element that will contain the dynamic elements.

Jquery live() vs delegate() [duplicate]

I never use live; I consider the benefits of using delegate to be so substantial as to be overwhelming. The one benefit of live is that its syntax is very close to that of bind: $(‘a.myClass’).live(‘click’, function() { … }); delegate, however, uses a slightly more verbose syntax: $(‘#containerElement’).delegate(‘a.myClass’, ‘click’, function() { … }); This, … Read more

jquery live hover

jQuery 1.4.1 now supports “hover” for live() events, but only with one event handler function: $(“table tr”).live(“hover”, function () { }); Alternatively, you can provide two functions, one for mouseenter and one for mouseleave: $(“table tr”).live({ mouseenter: function () { }, mouseleave: function () { } });

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)