Skip to Main Content
Adding Ajax
book

Adding Ajax

by Shelley Powers
June 2007
Intermediate to advanced content levelIntermediate to advanced
400 pages
9h 52m
English
O'Reilly Media, Inc.
Content preview from Adding Ajax

Old and New Persistence: Side by Side

A photo slideshow is probably one of the single-page applications most acceptable as a pure Ajax solution. It's not the type of thing one would expect to interact with using the browser's Back and Forward buttons, and it's not likely to have persistent links to any photo. Still, if users access a photo slideshow and have a browser extension like NoScript enabled, they will be faced with a blank page and will have to turn scripting on just to see what they're missing. No matter how nice the fades or the description pop-ups in the bottom, users come away a little less impressed than if the slideshow creator had just created the show using a traditional multipage approach and then added in the Ajax stuff. Not only will users with scripting disabled not be faced with a blank page when accessing the slideshow, the latter method also provides a way of managing the persistence problem that Ajax can add to a project.

The first slideshow, the photo slideshow, has been around quite some time, though most photo galleries and slideshows are managed via server-side code, not through Ajax (this is changing, quickly).

Implemented in PHP, an application like this would be given a collection of photos (usually in a subdirectory, but names listed in an array can also work). You can specify which photo to display by adding it as a GET HTTP request parameter, and also add these GET parameters as part of the URL to specify the Previous, Home, and Next links. These ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Ajax: The Definitive Guide

Ajax: The Definitive Guide

Anthony T. Holdener III
Ajax Design Patterns

Ajax Design Patterns

Michael Mahemoff
Web Development with JavaScript and Ajax Illuminated

Web Development with JavaScript and Ajax Illuminated

Richard Allen, Kai Qian, Lixin Tao, Xiang Fu

Publisher Resources

ISBN: 9780596529369Supplemental ContentErrata Page