Discuz Post data storage function

Source: Internet
Author: User
Discuz has a mechanism for discuz to save post data. when sending an interrupted message, the system saves the data by itself. when you log on to the discuz console next time, the following message appears: you have not submitted data to restore the data.

I want to learn this function.

Is ajax saved to the database? Or store cookies or something?


Please advise me which codes I want to learn.


Reply to discussion (solution)

1. if it is particularly important or requires a long time to edit the content, it is recommended that setinterval ajax save the user's draft information to the database (memcache and redis are better). This can also enable the boast browser
2. if it is not important, determine whether your browser supports HTML5 localStorage stored in localStorage if it is not supported stored in cookies, but the cookie does not store too much data because each request will pass the cookie

For the first method, refer to the blog system

The second method can refer to the http://www.zhangxinxu.com/wordpress/2011/09/html5-localstorage%E6%9C%AC%E5%9C%B0%E5%AD%98%E5%82%A8%E5% AE %9E%E9%99%85%E5%BA%94%E7%94%A8%E4%B8%BE%E4%BE%8B/

1. if it is particularly important or requires a long time to edit the content, it is recommended that setinterval ajax save the user's draft information to the database (memcache and redis are better). This can also enable the boast browser
2. if it is not important, determine whether your browser supports HTML5 localStorage stored in localStorage if it is not supported stored in cookies, but the cookie does not store too much data because each request will pass the cookie

For the first method, refer to the blog system

The second method can refer to the http://www.zhangxinxu.com/wordpress/2011/09/html5-localstorage%E6%9C%AC%E5%9C%B0%E5%AD%98%E5%82%A8%E5% AE %9E%E9%99%85%E5%BA%94%E7%94%A8%E4%B8%BE%E4%BE%8B/

Random answer

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.