brandonaaron / livequery

MIT License
477 stars 195 forks source link

Not working for elements from Ajax Call(?) #28

Open fuxifex opened 6 years ago

fuxifex commented 6 years ago

Hi, i've tried using livequery (both, the old and the new version) on Ajax Calls. Here I'm applying the plugin to Link elements inside an UL:

    ul.livequery("a", function(){
        $(this).click(function(){
                       // do something
        });
    });

I'm doing an Ajax call which adds LI elements to an UL like this:

    var li = "<li value='"+id+"'><a href='#'>"+valu+"</a></li>";
    ul.append(li);

the plugin should recognize it but doesn't .. I need to reapply the events to the elements. I'm using Chrome. Anything wrong with my code? Thanks

UPDATE: i found out that there's issues with Jquery - I've tried jquery-3.2.1.min.js - doesn't work - downgraded to jquery-2.2.4.min.js and it works!