等待5秒后再出现下载按钮(Wait 5 seconds before download button appear)

编程入门 行业动态 更新时间:2024-10-11 03:20:08
等待5秒后再出现下载按钮(Wait 5 seconds before download button appear)

我知道如何使用javascript,但我需要一个安全的方法来做到这一点。 任何人都可以查看页面源,获取链接,不要等待5秒。

有什么解决方案吗? 我正在使用javascript和django。 谢谢!

I know how to do that with javascript but I need a secure way to do it. Anybody can view page source, get the link and do not wait 5 seconds.

Is there any solution? I'm working with javascript and django. Thanks!

最满意答案

唯一安全的方法是将逻辑放在检查时间的服务器上。 对服务器进行Ajax调用。 如果时间不到5秒,请不要返回HTML,如果大于,则返回要显示的html。

其他选项是让链接指向您的服务器,如果时间少于五秒,则将它们重定向到另一个页面。 如果大于5,则会将它们重定向到正确的内容。

无论哪种方式,它都要求您跟踪服务器上的会话时间并将其从客户端中删除。

The only secure way would be to put the logic on the server that checks the time. Make an Ajax call to the server. If the time is under 5 seconds, do not return the HTML, if it is greater than , than return the html to show.

Other option is to have the link point to your server and if the time is less than five seconds it redirects them to a different page. If it is greater than 5, it will redirect them to the correct content.

Either way, it requires you to keep track of session time on the server and remove it from the client.

更多推荐

本文发布于:2023-08-04 18:38:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1419179.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:现下   再出   按钮   Wait   download

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!