Reputation:
Simply put: I have a single-page website, for instance www.example.com. How do I make a link pointing to www.example.com/sub not trigger an unload, but still change the address bar as if it did?
Upvotes: 0
Views: 57
Reputation: 198388
HTML History API can do this.
history.pushState({data: "foo"}, "SubPage", "http://www.example.com/sub")
You can kind-of use History JS to shim it in for the older browsers (it will fake it with hash links in non-compliant browsers).
Upvotes: 1