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

Pjax fails when dealing with meta tags with dynamically added tags. #430

Open
Yahav opened this issue Oct 3, 2023 · 4 comments
Open

Pjax fails when dealing with meta tags with dynamically added tags. #430

Yahav opened this issue Oct 3, 2023 · 4 comments
Labels
working as intended The behavior described is the intended behavior; this is not a bug

Comments

@Yahav
Copy link
Contributor

Yahav commented Oct 3, 2023

Describe the bug

Please look at the following:
#429

To reproduce

No response

Expected behavior

No response

Environment

- OS:
- Browser:
- Pjax:

Anything else?

No response

@PaperStrike
Copy link
Owner

You may try to use more specific selectors like meta[name=foo] or with exclusion like meta:not([name=bar]), or custom switches described in #429 (comment) . Would these be able to solve your issue?

@Yahav
Copy link
Contributor Author

Yahav commented Oct 3, 2023

Wouldn't work since i don't have head as a selector, when it is the automatic script execution causes issues . one example is when a script tag is added by another script after the dom switch but before preparePage the it's executed twice which causes all kind of issue. i'm handling all the scripts execution myself with hooks, far more flexible.

I still think that since meta are unique tags they should be handled differently (as i stated at the discussion)

@PaperStrike
Copy link
Owner

Wouldn't work since i don't have head as a selector

So why not use a head selector?

@PaperStrike
Copy link
Owner

one example is when a script tag is added by another script after the dom switch but before preparePage the it's executed twice which causes all kind of issue.

Are you adding script tags in the switchesResult hook? What exact scenario is this for? Most of the time these operations should be done
in a pjax:success/pjax:complete event callback.

@PaperStrike PaperStrike added the working as intended The behavior described is the intended behavior; this is not a bug label Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
working as intended The behavior described is the intended behavior; this is not a bug
Projects
None yet
Development

No branches or pull requests

2 participants