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