https://github.com/integralist/html5-history-api
Takes the pushState example from 'Dive into HTML5' and enhances it.
https://github.com/integralist/html5-history-api
Last synced: 4 months ago
JSON representation
Takes the pushState example from 'Dive into HTML5' and enhances it.
- Host: GitHub
- URL: https://github.com/integralist/html5-history-api
- Owner: Integralist
- Created: 2011-06-16T19:37:08.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2012-04-14T15:47:51.000Z (about 14 years ago)
- Last Synced: 2024-12-31T13:43:38.304Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 686 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[Integralist](http://www.integralist.co.uk/) - HTML5 History API
================================
Description
-----------
This is an 'extended/improved' version of the example found in the '[Dive into HTML5](http://diveintohtml5.org/history.html)' online book.
In the example the author demonstrates a photo gallery that links to different pages.
Each page has the same content/layout, the only difference is the photo being displayed.
My issue with the example was that the home page had the full HTML layout/css but all other pages linked to only had the relevant section of the HTML for the gallery.
I appreciate this made his example simpler to understand how the XMLHttpRequest was pulling in the fresh data and populating the current page, but I prefer a 'fuller' more realistic example where the HTML for all subsequent pages are also full pages and not just the HTML for the gallery/photo.
For example, in the original version, if you disabled JavaScript then yes the link to the other page would still be accessible, but the design of it would be plain black text on white background because those pages don't feature the full HTML/CSS. So without JavaScript the page wasn't a good enough user experience (in my opinion).
My example makes sure that if JavaScript is disabled then even the subsequent pages have a full design as per the initially loaded page (and means if a user is linked through from a search engine to a subsequent page that wasn't the home page - and they happen to have JavaScript disabled - then they would still see a fully 'designed' page!)