Implement the forward and backward functions under AJAX

Source: Internet
Author: User

This problem is always plagued during the process of making this BLOG ....

 

There are three methods to make a big difference:

1. Each time the client interacts with the server, it must change the URL value. In this way, IE will record the historical status of the page, so we can use IE's forward and backward to implement the present. This should be the most acceptable way for users, because everyone is also used to the browser's forward and backward functions.

 

2. Each time the client performs a function, an array is used to record the information on the next page, and the forward and backward buttons are added to the page to read the information in the array, so as to implement the forward and backward functions, but I think this should be the most undesirable way. Imagine when a user performs many operations on the client, the array used to record page information will become very large, so that the memory of the client will be eaten sooner or later, which is quite risky!

 

3. Record the name and parameter information of each JAVASCRIPT method called by the client, and form an array. Add forward and backward buttons to the page to read the array, every forward and backward operation will re-send the server. I feel that this method is implemented, but I am still pondering the method for creating this array.

I checked on the internet and it seems that there is support for the class library of the first method, but I personally don't like it too much, it seems that every time the client overwrites the URL, it will also cause the progress on the status bar to be refreshed, you may say that it is okay to refresh the server and not send it back to the server, but it is uncomfortable. Alas, the problem is still not solved. You have to continue learning. Haha, it's off work. Continue thinking tomorrow!

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.