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