B/S offline Technology Design and Implementation

Source: Internet
Author: User
In fact, B/S is very easy to do offline, and data can be implemented in the cache, but if there is data callback or data verification, it will not be a problem. therefore, I personally think there are several methods to achieve this: Method 1: 1) data is cached in the client's webpage using arrays or XML for interaction with JS; 2) when saving, if it is online... syntaxHighlighter. all ();

In fact, B/S is very easy to do offline, and data can be implemented in the cache, but if there is data callback or data verification, it will not be a problem.
Therefore, I personally think there are several methods to achieve this:
Method 1:
1) data is cached in the webpage of the client using arrays or XML for interaction with JS;
2) When saving, if it is online, it will be directly saved to the server. If it is disconnected, it will be saved to the XML or JS array of the webpage;
3) when the network is connected, use XMLHTTP to upload offline data to the server.
Method 2:
1) The data is cached to the XML file of the client and loaded to the page in JS mode;
2) When the file is saved, the client XML file is saved first. If the network is online, the file is directly sent to the server and XML is cleared;
3) connect the network to synchronize XML to the server
Both methods can achieve the offline and power-off functions. They also have their own advantages,
Method 1: the user cannot close the current website or system, Because XML is available on a webpage hidden by the Frame side. After the website is closed, data is lost ..
Method 2 solve the problem of file read/write permissions and encryption/decryption on the client;
I personally chose method 2, which is verified by ActievX + digital signature + XML + MD5 file.

Javascript code

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.