defunkt / jquery-pjax

pushState + ajax = pjax
https://pjax.herokuapp.com
MIT License
16.73k stars 1.97k forks source link

reload javascript external source(?) #624

Closed fari-99 closed 8 years ago

fari-99 commented 8 years ago

Hello, this is my first time using this plugin, so I want to make sure I'm on the right track,

the Pjax is working fine and all, but if I go to a page (example 'A' page) who have a script and CSS in there, the page not load it (i must refresh the page to fully load it), I'm using an external script like this in the bottom of 'A' page

<link href='localhost:8000/css/owl.carousel.css' rel='stylesheet' type='text/css'>
<script src='localhost:8000/js/owl.carousel.js'></script>
<script src='localhost:8000/js/myJSfunction.js'></script>

I'm already see this issue #600 and #331, because lack of my knowledge in this matter i don't know where i should fix my problem. or at least can i load my external script in this code $(document).on('ready pjax:success', function(){ loadJS(); }) ?

Thanks,

Best Regard.

fari-99 commented 8 years ago

maybe we can use layout reloading? I don't understand what it is, and I don't know how to use it in Laravel, can someone help?? haha T_T.

fari-99 commented 8 years ago

sorry, i just found out that all my JS library is not using your requirement like this if DOM is ready $(document).on('ready pjax:success', function() { //code here }); (because another js for css create by someone else).