Deluxe asynchronous navigation

You'd be downright pleased with yourself for taking an ordinary site and turning it into a single-page application in just a few lines of code, but let's face it: our simple asynchronous navigation leaves a little bit to be desired and could definitely use a bit of polish.

Perhaps most obviously, we've broken the back and forward buttons in the browser. We can no longer use them to navigate between the pages of our site. We've also taken away our site visitor's ability to bookmark or share a link to a page of our site. We also don't give any feedback to our site visitor that anything is happening after they've clicked a link in our main navigation. Since our pages are short and simple, they should usually load up pretty quickly, but the Internet is notoriously unpredictable in the speed department. Sometimes it could take a half second, a full second, or more to load up our content—and our site visitor has no idea their browser is hard at work trying to get the new content for them—it just looks like nothing's happening.

There are a few other nice touches we can add to make the whole thing nicer and faster too, so let's get started on the deluxe version of asynchronous navigation.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.238.20