Jump to content

is there way to delay a script from running?


jeger003

Recommended Posts

hello,

is there a way to pause a few seconds before running a script.

 

what im doing is, when a visitor clicks a download button. I want it to pause like 5 seconds and show a little logo before running the script to download the file.

 

 

any ideas with this?

 

Thanks Guys!

Link to comment
Share on other sites

With all due respect, JavaScript is not required

<html>
<head>
<meta http-equiv="refresh" content="5;url=http://yoursite.com/file.pdf">
</head>

<body>

Your file will download in 5 seconds. If it does not start automatically, click
<a href="http://yoursite.com/file.pdf">here</a>.

</body>
</html>

Link to comment
Share on other sites

With all due respect, JavaScript is not required







Your file will download in 5 seconds. If it does not start automatically, click
here.


 

No worries if that solves his problem, but it wasn't what he asked for.  He asked to click a button -- display a message and then do the download, so I discounted the meta refresh. 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.