ajax| Standard | program | browser
basic design ideas for backing back buttons in Ajax
In this section, we will discuss the basic steps needed to support the back button in an AJAX application and give a simple sample code that describes the steps required.
The simple example program, shown in Figure 1, will have a selection box in the interface that has two values: "Year 1" and "Year 2". For this program, we will track the history when the selection box value changes. This means that the user can first select Year 2 and then click the Back button to go back to the previous selection.
Figure 1. A simple sample program with a selection box
The sample program was originally a simple HTML form with JavaScript getter and setter (for selecting a box value):
We will first implement the first requirement: Create a history of the state. As we mentioned earlier, this requirement consists of the following three steps:
Create history
Save a meaningful state
Generate the appropriate URI
Add this URI to the browser's stack
We want to be able to save every change in the selection box. So we'll create a new URI that contains the state information for the selection box.
To conform to Internet standards, we will use the fragment identifier portion of the URI. In accordance with the terms of the IETF RFC 3986, "... As the main form of indirect client references, the fragment identifier plays a special role in the information retrieval system, and the 〈......〉 fragment identifier is detached from the rest of the URI before the reference is lifted, so the identity information in the fragment itself is discarded by the user agent, regardless of the URI scheme ... ".
Ajax: A new way to build Web apps
Discussion on the error handling mechanism of AJAX (2)
Discussion on the error handling mechanism of AJAX (1)
First experience. NET Ajax Brushless New technology
A brief analysis of Ajax development Technology in Rails system (4)