Skip to content

executeScriptTags will fail when using things like embedded Gists. #393

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

Closed
oswaldoacauan opened this issue May 26, 2014 · 5 comments
Closed

Comments

@oswaldoacauan
Copy link

When using scripts like embedded gists, who are designed to write after the script tag. Pjax will break the flux since it will append the <script> into <head>

Ref. oswaldoacauan/ghostium#52

@mislav
Copy link
Collaborator

mislav commented May 26, 2014

Good point. @josh do you think we might get away by injecting <script> tags in the pjax container?

@oswaldoacauan
Copy link
Author

@mislav i think the <script> need to stay where he starts. Just inject on pjax container will just break things in another place.

Think in a blog post with the following content

...
Here is code example 01
[GIST SCRIPT]
...
Here is code example 02
[GIST SCRIPT]
...

If we move the <script> from his default flux, things will break.

Ps. Sorry about my bad english.

@mislav
Copy link
Collaborator

mislav commented May 26, 2014

Yeah, I understand. Your English is good enough.

However if we just inject the script tags in their proper place in the DOM after pjax, document.write still won't work. It will only work if the page is loaded statically.

I guess pjax can't be used to load HTML contents that has script that rely on document.write.

@josh
Copy link
Contributor

josh commented May 26, 2014

Yep, document.write issues aren't fixable.

On May 26, 2014, at 8:07 AM, Mislav Marohnić notifications@github.com wrote:

Yeah, I understand. Your English is good enough.

However if we just inject the script tags in their proper place in the DOM after pjax, document.write still won't work. It will only work if the page is loaded statically.

I guess pjax can't be used to load HTML contents that has script that rely on document.write.


Reply to this email directly or view it on GitHub.

@josh
Copy link
Contributor

josh commented May 26, 2014

It makes no difference in execution are inserted into the dom. Scripts are always added to head for consistency since we only run them once. You can't unrun a script tag so sweeping them away between page transitions is more confusing.

On May 26, 2014, at 2:32 AM, Mislav Marohnić notifications@github.com wrote:

Good point. @josh do you think we might get away by injecting <script> tags in the pjax container?


Reply to this email directly or view it on GitHub.

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

No branches or pull requests

3 participants