Replies: 3 comments
|
Maybe you could elaborate a bit -- what behavior do you expect and what behavior do you actually see? In theory, your approach sounds ok, but as always it depends on the details. |
0 replies
|
@ionurboz If you found a solution to a question, it'd be great if you can post the solution instead of closing the discussion. That way, others can find it in the future :) |
0 replies
|
I couldn't find it; I further improved the behavior by adding a condition like "if (url.href !== location.href) {...}". However, because swup inherently expects an exact match between containers A and B, I abandoned the "history API" approach. Everything happens on the same page, so it's no longer necessary. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Updating Swup on external AJAX operations to the page
When we add new content to a page using an
AJAXoperation outside of Swup and add a parameter to the browserURL, we expect it to have a history. In this case, we could use "history.pushState({}, '', url);", but Swup will be out of the way (especially caches, etc.).To do this within the Swup ecosystem, I wrote the following code:
Do you think what I'm doing and what I want to do is doing the right thing? I don't understand why it's not working!
Swup ❤️
All reactions