skeeks-semenov / yii2-assets-auto-compress

Automatic compilation of js + css + html
https://skeeks.com/
BSD 3-Clause "New" or "Revised" License
157 stars 43 forks source link

Jquery Binding Events issue when jsFileCompile=true #14

Open 3dgroup opened 8 years ago

3dgroup commented 8 years ago

This is a really good extension but i have an issue:

Whenever i set jsFileCompile to true and load some AJAX my js events doesn't' fire. E.G. Load page Click button this fires: $(document).on("click", ".showModalButton", function () {

After ajax has loaded i click the button again and the event doesn't fire

I also have an onSubmit event that should fire on a form that was loaded via ajax this event is not fired.

All the functions work fine without the combining file open.

Hope you can help!

alinskydev commented 4 years ago

AJAX loads JQuery for the second time. Here is solution: https://forum.yiiframework.com/t/duplication-of-css-and-js-files-when-using-renderajax/76891/8