How to solve the Ajax page refresh Problem

Source: Internet
Author: User

How to solve the Ajax page refresh Problem

The problem frequently encountered in Ajax applications is Refresh: After a page is partially updated, the user refresh the entire page and the page returns to the initialization status, this is generally not the result that the user wants --------------- a headache. in fact, his solution and principle are very simple. The page refresh problem can be transformed into two problems:

1. How to save the page status before a user updates the page;

2. How to restore the status before updating the entire page;

Solution:

The most important thing to solve this problem is to use window. location. hash, that is, bookmarks. Hash is used to store the page state. The internal resolution mechanism can use this State to resolve the status to how to restore the page State. For example, use hash to store the query conditions of the current page, when refreshing the entire page, we can get the hash of the page address, and then convert the hash into a query condition for partial page update, so as to restore the page.

Note: The internal resolution mechanism is a conversion standard defined by myself, that is, how to convert the status to the Operation Processing Mechanism for restoring the Page Status, usually defined as the processing function of the page onload event;

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.