jquery、rails 3 和会话
我正在使用 Rails 3 创建一个带有登录表单的站点。
当未登录的用户访问我们的网站时,页面顶部会出现一个弹出框,显示“登录、注册或关闭此框”。
如果用户单击“登录”,他们将转到登录页面。如果用户单击“注册”,他们可以转到注册页面并添加其凭据。如果他们决定不想登录或注册,可以单击“关闭”来关闭该框。
如果用户单击关闭(这很好......),我使用 jquery 来隐藏该框,但是......如果用户在单击关闭后重新加载页面,该框会再次出现(我不希望这样。
)假设我需要使用某种会话来告诉浏览器他们已经决定关闭此框并且他们不想再次看到它(至少今天)。这公平吗?
另外,我可以在不重新加载页面的情况下设置此会话吗?
感谢您的帮助。
I am using rails 3 to create a site with a login form.
When a non logged in user visits our website, a popup box appears at the top of the page that says " LOGIN, SIGN UP Or CLOSE this box. "
If a user clicks LOGIN, they go to the login page. If a user clicks SIGN UP, they can go to a signup page and add their credentials. If they decide they dont want to login or sign up, they can click CLOSE, to close the box.
I am using jquery to hide the box if the user clicks CLOSE (which is good...) but... if the user reloads the page after clicking close, the box appears again (which I don't want.)
I was assuming I'd need to use some kind of session to tell the browser they've already decided to close this box and they dont want to see it again (at least today.) Is this fair?
Also can I do set this session without reloading the page?
Thanks for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看 jQuery cookie 插件。 http://plugins.jquery.com/project/Cookie
Check out the jQuery cookie plugin. http://plugins.jquery.com/project/Cookie