Skip to content
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

Head tag keeps multiplying with empty contents #83

Closed
aurimus opened this issue Feb 3, 2017 · 3 comments
Closed

Head tag keeps multiplying with empty contents #83

aurimus opened this issue Feb 3, 2017 · 3 comments
Labels

Comments

@aurimus
Copy link

aurimus commented Feb 3, 2017

Hi, any idea why this would be happening?

head_problem_pjax

var pjax = new Pjax({ selectors: ["head title", "body"] }) but it works the same if I remove the head title

@aurimus
Copy link
Author

aurimus commented Feb 3, 2017

You can inspect it here also: http://saulesinterjerai.lt/ same problem same code

@lacrioque
Copy link
Collaborator

Still an issue?

@BehindTheMath
Copy link
Collaborator

I believe this is being caused by the issue described here:

We can’t replace body.outerHTML or head.outerHTML. It creates a bug where a new body or new head are created in the DOM. If you set head.outerHTML, a new body tag is appended, so the DOM gets 2 bodys, & it break the switchFallback which replaces head & body.

See here for more information about why this happens.

The code there is supposed to prevent that by using this.switchElementsAlt() instead of the default outerHTML switch. However, I don't see switchElementsAlt() defined anywhere.

BehindTheMath added a commit to BehindTheMath/pjax that referenced this issue Dec 19, 2017
BehindTheMath added a commit to BehindTheMath/pjax that referenced this issue Dec 19, 2017
BehindTheMath added a commit to BehindTheMath/pjax that referenced this issue Dec 19, 2017
BehindTheMath added a commit to BehindTheMath/pjax that referenced this issue Dec 19, 2017
BehindTheMath added a commit that referenced this issue Dec 20, 2017
Add switchElementsAlt() to the default switches

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

No branches or pull requests

3 participants