Book Image

Practical Web Development

By : Paul Wellens
Book Image

Practical Web Development

By: Paul Wellens

Overview of this book

Table of Contents (23 chapters)
Practical Web Development
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
10
XML and JSON
Index

The problem we are trying to solve


Imagine a horizontal navigation menu where the visitor clicks on a menu item, just like the example we used in the previous chapter. In a classical website, the browser takes the visitor to a different page, for example, galleries.php, with its URL displayed by the browser. However, an Ajax-based site will simply update a part of the screen and not do anything with the URL bar each time the visitor clicks a menu item. No matter how many items they choose, once they push the browser's BACK button, they will find themselves back at the previous page, which will be the previous true page, and typically, a different website, and this is not where he expects to be.

We will solve this problem by using a technique that will restore the website to its previous state, as we cannot take it to the previous page. Before we go through the details, let's discuss a thing or two about pushing and popping states.