gpt4 book ai didi

javascript - 对话框 "Don' t 再次显示“boolean 值 : Where to store value?

转载 作者:行者123 更新时间:2023-11-30 07:44:50 26 4
gpt4 key购买 nike

我有一个 JavaScript 弹出对话框,每当用户调用特定事件时它就会出现,这可能很烦人。

我在服务器端使用 Ruby on Rails 连接数据库。

所以我在考虑一个输入复选框,这样对话框就不会再次出现,但用户应该能够再次更改值。

我应该在哪里存储 boolean 值?在数据库、session 甚至 cookie 中?

最佳答案

                      The answer is, "it depends".           If you want the setting to persist across visits to          the site, even from different computers, store it in                  the user's profile in your database.            If you don't have a user database, store it in a                           persistent cookie.         If you don't want it to persist (too long), store it in                           the (PHP?) session.          If you won't want it to persist at all, store it in a          per-session cookie (i.e. one without an expiry date)

关于javascript - 对话框 "Don' t 再次显示“boolean 值 : Where to store value?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8850216/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com