Skip to content

Conversation

fourteenmeister
Copy link

Sometimes it is necessary to add scripts dynamically. If you enable async option (true) pjax will operate as usual. If false, scripts to load synchronously.
Why do it? Scripts are loaded on the fly, and client scripts waiting until all the necessary scripts to connect to and then work out fine.

Sometimes it is necessary to add scripts dynamically. If you enable async option (true) scripts to load asynchronously. If false, pjax will operate as usual. Why do it? Scripts are loaded on the fly, and client scripts waiting until all the necessary scripts to connect to and then work out fine.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure appending to head will load scripts in async mode?

@fourteenmeister
Copy link
Author

Are you sure appending to head will load scripts in async mode?

Default async is true, so pjax work by default. Not quite correctly put it in the description. Fixed.

@fourteenmeister fourteenmeister changed the title It makes it possible to load asynchronously It makes it possible to append scripts synchronously May 8, 2015
@samdark
Copy link
Member

samdark commented May 8, 2015

Looks good to me but I think it's generic enough to go directly into pjax upstream. Worth creating a pull request against it as well.

@fourteenmeister
Copy link
Author

I think it's generic enough to go directly into pjax upstream.

Already, but they rejected. defunkt#423 (comment)

@SilverFire
Copy link
Member

#30 fixes the problem generally

@SilverFire SilverFire closed this Nov 19, 2015
@SilverFire
Copy link
Member

Should be fixed by #30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants