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;