简体   繁体   English

如何在Rails应用程序中首次访问站点时触发弹出模式

[英]How to trigger popup modal for first time visit site on rails application

Need Help!!! 需要帮忙!!!

It's make me get headache for a days, i need to set greeting modal for every visitor when they open my site for the first time, how would i do that 这让我头疼了几天,当他们第一次打开我的网站时,我需要为每位访问者设置问候语,我该怎么做

You need to maintain the cache on the local machine of the visitor and add count for the first time login on a day. 您需要维护访问者本地计算机上的缓存,并添加一天中首次登录的计数。 To maintain the cache on the local you can use local storage https://developer.mozilla.org/en/docs/Web/API/Window/localStorage 要在本地维护高速缓存,可以使用本地存储https://developer.mozilla.org/en/docs/Web/API/Window/localStorage

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM