O'Reilly logo

Web Development Recipes, 2nd Edition by Chris Johnson, Mike Weber, Chris Warren, Brian P. Hogan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Recipe 13Extending Endless Pagination with pushState()

Problem

One of the things that makes the Internet great is that, from news articles to cat GIFs, everyone can easily share links with one another. But with more applications using Ajax, this is no longer the case by default; clicking an Ajax link no longer guarantees that the browser’s URL is updated to reflect what the user is seeing. For many Ajax requests this is fine, but when large parts of the site change after a request, not keeping the URL up to date can cause issues. Not only does this prevent the sharing of links, but it breaks the back and refresh buttons.

Unfortunately, the endless-pagination code we wrote in Recipe 12, Displaying Information with Endless Pagination, has ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required