xeoncross / jr

Jr. the static, static javascript site generator (you should see this)
Other
759 stars 39 forks source link

Add History.pushState #1

Open xeoncross opened 10 years ago

xeoncross commented 10 years ago

We should have a simple History.pushState method for new browsers wthat could load the new page via-AJAX and then gracefully replace the content and update the URL.

aravindet commented 10 years ago

Since the entire file would have to be loaded via AJAX, the primary motivation for doing this (reducing page size) is gone. What advantage would this provide, and is it worth the complexity?

xeoncross commented 10 years ago

Actually, there are two things this would help with. First, using History.pushState would increase the page render time as the DOM would not re-render the entire chrome. Second, it would remove the FOUC a new page load might still have even with the caching we are doing.

We only need to implement this for modern browsers (the only people who even care about FOUC) so the code to implement this shouldn't be more than a few dozen lines.