发布前保存数据离线 [英] Save data offline before post

查看:97
本文介绍了发布前保存数据离线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



大部分时间用户在使用电脑之前,都会将发布的数据保存到用户电脑上,然后才发布不良网络连接。写文章,添加图片和点击提交按钮时,他们的连接由于某些问题而丢失。



那么在php,ajax,jquery中有一种方法。我可以这样做,以保存输入时或发布之前,所以如果互联网连接出现问题,他们可以返回时,它是起来和后??

解决方案

在您的表单中添加提交侦听器,然后提交将所有表单输入值保存在浏览器的本地存储中。在较旧的浏览器(IE)中,您可以填充这个不存在的功能。



查看 list 浏览器存储polyfills。


i want to save the post data to user pc before posting just incase of bad internet connection where it happens a lot in my area.

most of the time users write article , add images and when clicking submit button their connection is lost due to some issues .

so is there is a way in php , ajax , jquery . that i can do to save that while typing or before posting so if internet connection goes wrong , they can return when it is up and post ?

解决方案

Add a submit listener to your form, prior submitting save all the form input values in the browser's local storage. In older browsers (IE) you can "polyfill" this non-existent functionality.

Have a look at this list of browser storage polyfills.

这篇关于发布前保存数据离线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆