spfjs
spfjs copied to clipboard
Document how SPF handles anchor links
The SPF documentation needs to describe how anchor links (aka hashes aka fragments, eg /path#frag
) are handled.
For example, from https://groups.google.com/d/msg/spfjs/zhdS3GQJEiY/IkR6w9ZSBAAJ
Also, when navigating between two URLs that only differ by the hash, SPF won't make a request, just scroll the page (if possible).
Here's an example of what happens when clicking or going back across some links:
[load] /foo [click] /foo --> /bar (request /bar) [click] /bar --> /bar#target (scroll to #target) [click] /bar#target --> /other (request /other) [back] /other --> /bar#target (request /bar, then scroll to #target) [back] /bar#target --> /bar (scroll to top) [back] /bar --> /foo (request /foo)
+1 — this is obvious to those who have implemented something like SPF (for example: Turbolinks or https://www.drupal.org/project/refreshless), but not to everyone. It's valuable to have this documented, to prevent confusion, help future maintainers and avoid having to repeat the same answers.