记住复选框值
嗨,如果有人能对此有所了解,我将非常感激,基本上我有一个使用 jqtouch 和 PhoneGap 构建的 iPhone 应用程序,其中有一个标准复选框列表,当选择它们时,将应用删除线效果,足够简单(有点就像一个简单的清单)这一切都在客户端处理,并且不会将任何内容发送到任何地方。
但是,当用户关闭应用程序时,复选框将恢复到原始状态,即全部未选中,我希望它们在用户离开时保留。我想本地存储将是做到这一点的方法,但是,我已经尝试过,但我有点困惑。
任何帮助都会很棒,提前感谢您。
凯尔
Hi I would be so grateful if anyone could shed some light on this, Basically I have a iphone app built using jqtouch and phonegap which has a list of standard checkboxes and when they are selected a strikethrough effect will be applied, easy enough (kind of like a simple checklist) this is all dealt with on the client side and nothing will be getting sent anywhere.
However, when the user closes the app the checkboxes revert to their original sate i.e all unchecked and i would like them remain as the user left them. I guess local storage would be the way to do this, however, i have gave it a go and i am getting a bit confused.
Any help would be great, and thank you in advance.
kyle
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
给你:
我自己花了一些时间才正确地写出它,但我认为这是值得的。默认状态处理由您决定(例如当已使用 HTML 选中复选框时)。
Here you go:
Took some time to write it correctly myself but I think it's worth it. The default state handling is up to you (like when a checkbox is already checked with HTML).