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

Chapter 7. History, Navigation, and Place with Single-Page Applications

Ajax tends to operate outside the normal web viewing experience. Usually, you click a link to a page, your browser opens another page, you click another link to another page, it's loaded into the browser, and so on. If you wanted to return to the original page, you would click the Back button, navigating back through all the pages visited in the current session. If you wanted to bookmark a page or create a link to the page, you would just copy the URL that's loaded in the browser's navigation bar.

When web applications are created as single-page applications, where all content is managed and loaded on demand via JavaScript, the Back button is useless, as is the concept of a page URL; there is no sense of place when Ajax is used to load and unload page content. As Alex Bosworth wrote in May 2005 (at http://sourcelabs.com/ajb/archives/2005/05/ajax_mistakes.html):

The back button is a great feature of standard web site user interfaces. Unfortunately, the back button doesn't mesh very well with JavaScript. Keeping back button functionality is a major reason not to go with a pure JavaScript web app.

Lack of real web paging is also a big issue for much of a site's advertising. Before Ajax, ad costs were based on the number of page views for a site. Now, if content can be loaded willy-nilly into any page that opens, page views no longer reflect what's really going on with a site.

Search engine optimization also takes a ...

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