I am using pjax for most of my pages. For some of them I need to include jQuery scripts.
When I load a page with pjax all scripts in $(document).on('ready pjax:success', function() { ... }
are working fine, although if the page is loaded directly scripts in above function will not work, and other way round - scripts inside $(document).ready(function() {...}
wont work if page is loaded with pjax.
Is there a way to detect if the page was loaded with pjax and use document.ready if it wasn't?
Thanks for all help in advance.
See https://api.jquery.com/ready/
My quick fix was this: