You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some of the pages loaded by jquery-pjax requires other javascript and jquery libraries and I include them along with the page content and title.
There are also some inline scripts that uses those libraries.
The problem is that the inline script is executed before the js library is loaded.
What I did is to move the line executeScriptTags(container.scripts)
just after the: if (container.title) document.title = container.title
so the inline script to be executed after the js is loaded
But now the script works on the second page visit. The first visit still gives an error that the library is missing.
Any possible idea for solving this?
The text was updated successfully, but these errors were encountered:
You'll have to change your site, unfortunately. Your inline scripts will now have to be aware that the libraries they depend on might be loaded async. Maybe you could do a repetitive setTimeout until a "constant" that you rely on gets defined.
A much better solution, on the other hand, would be to get rid of inline scripts. See #393 for an example how script tags sometimes simply cannot work with pjax model.
Some of the pages loaded by jquery-pjax requires other javascript and jquery libraries and I include them along with the page content and title.
There are also some inline scripts that uses those libraries.
The problem is that the inline script is executed before the js library is loaded.
What I did is to move the line
executeScriptTags(container.scripts)
just after the:
if (container.title) document.title = container.title
so the inline script to be executed after the js is loaded
But now the script works on the second page visit. The first visit still gives an error that the library is missing.
Any possible idea for solving this?
The text was updated successfully, but these errors were encountered: