AJAX is praised for their rich expressiveness, more interaction, and more agile responses. these advantages are obtained by dynamically loading data using the XMLHttpRequest object, instead of re-loading the new page. In a large number of publicity
AJAX is praised for their rich expressiveness, more interaction, and more agile responses. these advantages are obtained by dynamically loading data using the XMLHttpRequest object, instead of re-loading the new page. In a large number of publicity and excitement, some criticism points out that AJAX uses damage to some important browser features, which include support for the forward and backward buttons.
This article first explains why the forward/backward buttons and other browsers cannot work properly unless you understand the functions in AJAX. Then, let's briefly list how developers solve the above title. Finally, let's take a look at how the Backbase AJAX engine provides support for the forward/backward buttons and other browser functions.
Does AJAX require a backend button?
AJAX promises developers to develop browser skills with only application standards with better user experience and highly interactive WEB use, which often refer to DHTML.
In the past, developers often had to make choices between rich and reach. The former refers to highly interactive user interfaces, the latter is a front-end terminal that runs on all WEB browsers without additional installation mechanisms. The use of AJAX will make the front-end terminal both "rich" and "reach ".
But what exactly is the meaning of a real interface "rich? What is the meaning of using "reach?
The concept of "rich" is not easily defined, but is easy to understand. If you see a "rich" interface, you will understand what the "rich" interface is. Desktop exploitation like Microsoft's Office is a "rich" interface. A "rich" interface applies advanced UI control techniques, such as Tabs and high/low text menus. They provide a means of intercommunication, such as the drag-and-drop and highlighting of the UI element when they get the focus. Traditional browsers are not "rich. They are restricted in some simple controllers, such as Form, and the interaction is just a simple dependency click link to a new page. Look at Microsoft's email client to see the difference: Outlook is "rich", and hotmail is not.
AJAX is praised for their expressive power. Google's Gmail is a common example. Other Google AJAX applications, such as Google Suggest and Google Map. Microsoft's forthcoming Web mail client, codenamed "Kahuna", or Backbase RSS Reader, also contains an advanced controller and an intercommunication model. Take a look at Dan Grossman's List: Top 10 Ajax Applications, which is an exciting list of "rich" interfaces.
Therefore, I can draw a conclusion that AJAX uses the concept of satisfying "rich. But does it meet "reach?
In most basic forms used by AJAX, if the interface runs in a WEB browser, this exploitation is "reach. AJAX is based on a browser, so it can be visited by a browser.
However, it is not enough to be understood by browsers. In his article Flash: 99% Bad, Jakob Nielson pointed out that Flash: "damages the basic interaction style of the WEB ". When the application WEB is used, the end user looks at a determined interaction style. Use the traditional WEB interaction style and provide the following availability features:
You must provide the "back/forward" button to view web page history.
Users can apply bookmarks
Deep links must be provided so that users can email them to friends or colleagues.
The "refresh" button must be provided to refresh the current status, instead of being obtained through reinitialization.
Developers can view the source code through the "view source" application.
End users can apply "find" to search pages
The search engine can index webpages and generate a Deep link to search for them.
Taking a look at the 10 top-level AJAX exploitation, it shows that most of the current AJAX exploitation does damage the basic interaction style of the WEB. In the following section, we will take a look at why many AJAX applications are like this.
Why does AJAX often corrupt the back button?
What we know today is based on the following three principles:
Application (D) HTML interface
Use HTTP to communicate with customers/servers
Application URIs addressing
The above principles determine that the WEB application we obtain has certain limitations, and AJAX makes the interface richer by breaking through these limitations. As described in my previous article: A Backbase Ajax Front-end for J2EE Applications. AJAX introduces a widely used java script (J in AJAX) to create a rich UI controller and interaction. AJAX also introduces asynchronous XML communication (A and X in AJAX). This is to import the XMLHttpRequest object to the new data and presentation layer logic without page refreshing. However, the current AJAX model cannot identify how to process URIs.
As a direct result of transforming the application (D) HTML and HTTP, AJAX uses the back button and other elements that damage the basic WEB interaction style. In the rest of this article, I will explain how to fix this corruption by processing URIs in the AJAX method. First, I will explain why URIs is related to the interaction of traditional WEB exploitation.
In terms of user interaction, the user interface status changes. The end user initiates a status change. The browser client sends a page request to the server to handle the status change (REST principle ), the server sends a new page and a new URIs to the client to generate a new interface status.
In short, every user interaction is not handled in this way. The following results are generated through the server loop:
Generate a new page
Generate a new URI
Because the browser records the continuous URIs in its history stack and displays the current URI in the address bar, the WEB availability feature is activated. In the address bar, you can copy the URI and send it to friends. When you click the return button or paste a URI from the email address bar, a cycle to the server is triggered. Because the server is responsible for state management, the server can generate corresponding pages.
The biggest difference between AJAX exploitation and traditional WEB exploitation is that AJAX can process User interaction without page overloading. An example is to load data from the server using the XMLHttpRequest object. Using java script to process the client drag-and-drop is another example.
In the preceding two examples, status changes are not obtained by generating a new URI. Therefore, clicking the back button or refresh button cannot obtain the desired result, and there is no deep-link URI in the address bar.
In order to provide traditional WEB availability features, AJAX needs to process the URIs client like traditional WEB exploitation. Therefore, AJAX needs to do the following:
When the status of a client changes, a URI is generated and sent to the client.
When a new URI is begged by the client, it is retained.
After the above two points are met, the browser's historical records will work, and the browser's address bar will display a URI that can be sent to a friend.
Another difficulty is to determine when the AJAX engine should do the above two things (for example, what kind of status change will lead to a new URI ). In the traditional mode, each page is refreshed, resulting in a URI update. In AJAX mode, each client event may generate a URI to the browser stack. Interaction designers and developers will decide what kind of status change is meaningful. Therefore, only new URIs are generated for those meaningful state changes.