且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

页面/浏览器关闭/退出时自动保存/提交表单

更新时间:2022-03-13 22:42:53

Jquery插件,用于自动保存功能。
http://plugins.jquery.com/project/jquery-autosave

Jquery plugin, works a treat for autosave function. http://plugins.jquery.com/project/jquery-autosave

更多信息:
http ://rikrikrik.com/jquery/autosave/#examples

包含插件:

<script type="text/javascript" src="scripts/jquery.autosave.js"></script>
    $('form.formnamehere').autosave({
      'interval': 20000
    });

自动提交表格而不刷新页面。

Auto submits form without page refresh.

我已将间隔设置为1秒(1000),因此表格每秒都会保存。因此,如果用户在编辑后退出表单,则表示已自动保存。

I have set my interval to one second (1000) so the form gets saved every second. Therefor if the user exits the form after editing then it has autosaved.