Such a problem - I use on the site barba js - a type script to implement transitions between pages using ajax.
The problem is, after the content is loaded by the Ajax, the scripts that are added to the head do not work. I do not understand how to make everything work. I tried using .on('click') to launch manual functions, which seems crazy, but it doesn’t work, scripts can be cut if you do setTimout inside the on click setTimout , that is, click on the link, after a second the function is started, then everything is OK, but this nonsense, firstly a delay, secondly all functions manually started - this is tin.
When I manually made Ajax transitions, without plug-ins, I started all the functions manually in the Sacks section, but I also believe that this is a crutch. Why is it not possible to globally declare all third-party scripts so that they work when the Ajax content changes? How do sites on Ajax, do they call for a new function every time?
The whole Internet was climbing - everyone advises deferred hanging of events - on, but then what should be the event (what event after the Ajax call)? If on click, then described above that only works with a timeout.