Which one is better? Using fragment identifiers...
http://www.alinkthatdoesnotwork.com/#!/dir1/dir2/file.html
...or the new Javascript History API?
https://github.com/examplethatdoesnotwork/project/src/script.js
Or should I use both? (via fallback)
Aspects:
Hashtags are a means to categorise content on Twitter, you mean fragment identifiers.
Using fragment identifiers to indicate what content to load via Ajax is a terrible idea. They are a hack that is fragile, search engine unfriendly (except with more hacks on both sides) and depends on JavaScript.
The history API is a robust system that is actually designed to do that job. The only problem with it is browser support, but (unlike the fragment identifier approach) it gracefully degrades to real URIs that will be passed directly to your server (which is what Github does).
Even Twitter appear to be about to switch to the history API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With