-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recent commit causes issue with external and inline scripts #502
Comments
What exactly is the navigation when "pjax does its thing"? Do you click a link? Do you press browser back button? |
Yes, sorry, that wasn't clear. When clicking through to a different page via pjax the code at 0019136#diff-256b2e7d3ffe31142c00fa086e15d3a6R551 runs. This (as far as I can tell) marks the inline scripts as being runnable again. Then when the user hits "back" in the browser those scripts run again, and the one mentioned above has the |
Do you expect external jQuery to be reloaded every time? Why would you want that? Can't you move jQuery and |
No, I never said I wanted that. Nothing has changed with how external scripts are handled. It is pjax's handling of inline scripts which has changed, and which is causing issues for me. The purpose of this ticket is to point out that a pair of external and inline scripts might be used in this sort of way, in case it had not been considered. Perhaps you would want to reconsider rerunning one kind but not the other. And perhaps not. It does seem odd to me that they would be handled differently.
No. As explained above, these scripts are injected by a debugging tool. I can't choose where they go. And I also acknowledged that it is likely best fixed there in that tool. |
I see. Thanks for reporting this. I'll switch to unmarking Until then, pjax doesn't work well with page contents that has a mix of external |
Closing in favor of the above referenced issue (referenced scripts executing async). |
Commit 0019136 introduces an issue on a site I'm working on.
I'm using the PHP debug bar, which injects some code at the end of the body tag of the page. The code includes an external script (jquery, in case you didn't already have it loaded, and whatever code it needs to run) and then an inline one (
jQuery.noConflict(true)
).When pjax does its thing, the external one is skipped but the inline one runs. This has the effect of knocking out my instance of jquery, and then my page breaks.
This is most likely PHP debug bar's bug (I imagine noConflict could be included in the external script, and then we wouldn't have this problem), but I wanted to flag it in case it's a case you hadn't considered.
The text was updated successfully, but these errors were encountered: