jquery表单缓存插件formcache

 
更多

Form Cache是一个简单jquery表单缓存插件。允许读取表单常用输入框、密码、单选、复选、多文本框的值存入缓存,允许JS调用读取缓存、修改缓存、删除缓存。

<script src="/path/to/jquery.js"></script><!-- jQuery is required -->
<script src="/path/to/formcache.js"></script>
 
<form data-toggle="formcache"></form>
//将缓存中的数据恢复到表单中data-toggle="formcache"
$('form').formcache() 
//缓存表单
var cache = $('form').formcache('serialize');
$('form').formcache('setCache', cache);
//清除已经缓存的表单数据
$('form').formcache('removeCache');

当然,还有更多的使用方法请参考https://github.com/fengyuanchen/formcache

浏览器兼容性: Chrome 31+ Firefox 31+ Internet Explorer 8+ Opera 26+ Safari 5.1+ iOS Safari 7.1+ Android Browser 4.1+ Chrome for Android 39+

打赏

本文固定链接: https://www.cxy163.net/archives/2585 | 绝缘体

该日志由 绝缘体.. 于 2024年12月02日 发表在 未分类 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: jquery表单缓存插件formcache | 绝缘体

jquery表单缓存插件formcache:等您坐沙发呢!

发表评论


快捷键:Ctrl+Enter