Discuz about posting data saving function

Source: Internet
Author: User
Discuz Post There is a mechanism, when the transmission is interrupted, will save the data, when the next time you log in, appear: You have the last uncommitted successful data recovery data

I want to learn this feature.

is Ajax saved to the database? Or a cookie or something?


Please advise the main is what code on the can, I go to learn.


Reply to discussion (solution)

1. If it is particularly important or requires a long time to edit the content suggested setinterval Ajax to save the user's draft information to the database (Memcache, Redis better) This can also achieve the browser
2. If it is not important, determine whether the user's browser supports HTML5 localstorage saved in Localstorage if it is not supported in the cookie store but the cookie does not save too much data because each request will pass a cookie

The first way to refer to the blog system

The second way can refer to 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 suggested setinterval Ajax to save the user's draft information to the database (Memcache, Redis better) This can also achieve the browser
2. If it is not important, determine whether the user's browser supports HTML5 localstorage saved in Localstorage if it is not supported in the cookie store but the cookie does not save too much data because each request will pass a cookie

The first way to refer to the blog system

The second way can refer to 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.