我如何...为pdf文件设置计时器 [英] How do i...set a timer for pdf file

查看:1175
本文介绍了我如何...为pdf文件设置计时器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在浏览器标签页中设置pdf文件的计时器



我尝试了什么:



i尝试了很多方法,他们可以解决

how can i set a timer for a pdf file open in a browser tab

What I have tried:

i have tried so many methods,they coudnt work out

推荐答案

你不应该在你的ASP.NET中这样做代码,因为它在服务器上运行。使用JavaScript可以更好地处理客户端这种情况。 JavaScript有一个 setTimeout函数 [ ^ ]您可以使用它来运行一定数量的函数后时间。在此功能中,您可以将用户重定向到PDF文件。

You shouldn't do this in your ASP.NET code, because that runs on the server. This case is better handled client-side, using JavaScript. JavaScript has a setTimeout function[^] which you can use to run a function after a certain amount of time. In this function, you can redirect the user to a PDF file.
setTimeout(function() {
    window.location = "/path/to/your/file.pdf";
}, 5000); // 5000 milliseconds = 5 seconds. Adjust if necessary.


这篇关于我如何...为pdf文件设置计时器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆