473,414 Members | 1,751 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Please Wait X Seconds... Url Revealer

Hey I need help (doesn't everyone?) on a script. The script functions like this:
Please wait X seconds for download (for example x=15 seconds)
Please wait 14 seconds for download (and then a second later)
Please wait 13 seconds for download... (process keeps repeating)
Click here to download the file you requested (occurs at 0 seconds)

Does anyone know of a script like that one? I have seen many sites use it including megaupload.com. I am running a site with many downloads and the ones that are files over 3 megabytes must have a timer inorder to conserve bandwidth (and files over 5 megabytes download speed will be limited to 25kbps, but I have found a script on how to do that using php). If you know what language this script is written in (I am guessing javascript or php) and could possible provide me with an example or a place I can find that script it would be of a great help to me. Thanks a bunch.
Jul 16 '06 #1
2 6007
iam_clint
1,208 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body onload="waittimer();">
  3. <script>
  4. var secs
  5. var timerID = null
  6. var timerRunning = false
  7. var delay = 1000
  8. function waittimer() {
  9.     secs = 10
  10.     StopTheClock()
  11.     StartTheTimer()
  12. }
  13. function StopTheClock() {
  14.     if(timerRunning)
  15.         clearTimeout(timerID)
  16.     timerRunning = false
  17. }
  18. function StartTheTimer() {
  19.     if (secs==0)
  20.     {
  21.               StopTheClock()
  22.     document.getElementById("time").innerHTML = '<a href="downloadlink.exe">Link</a>'
  23.  
  24.     }
  25.     else
  26.     {
  27.         document.getElementById("time").innerHTML = secs + " SECONDS Untill Download"
  28.         secs = secs - 1
  29.         timerRunning = true
  30.         timerID = self.setTimeout("StartTheTimer()", delay)
  31.     }
  32. }
  33.  
  34. </script>
  35. <div id="time"></div>
  36. </body>
  37. </html>
  38.  
heres a small example i made up for you se you get todo the rest :P its a countdown yadda yadda if you need help with it let me know
Jul 16 '06 #2
HOLY KDJSFKFJDS THANX 200000X. I spent over 2 hours searching for this type of script... you are my hero :)
Jul 17 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Pudibund | last post by:
Ok, I've spent nearly a week trying to sort what should be an easy task to accomplish but I'm totally flumoxed! I want to do something pretty simple... 1. display image1 2. wait until...
5
by: Erwin Kloibhofer | last post by:
what if i have a webpage that displays the text "please wait, this may take a few seconds..." and it now waits until some event on the server happens. whatever this is, this can be quick, but it...
1
by: pokémon | last post by:
Can someone please post a working example of how to use the WaitAny() method. Thanks.
5
by: Chris | last post by:
Hi, I was following the article http://msdn.microsoft.com/msdnmag/issues/03/12/DesignPatterns/default.aspx I got everything working until I go the the Progress bar section. Here is where I am...
15
by: Snuyt | last post by:
Hello, I want the program to wait a few seconds between executing code. It should look something like this: public sub xx() ...code... wait(2) 'wait 2 seconds ...code...
4
by: puja patel | last post by:
hi all, I am developing a shopping cart website in C# where after selecting item, user enters credit card details and click on submit button.This request is then processed by the gateway which...
4
by: MrDeej | last post by:
Hello guys! I am trying to use trevors wait function on my odbc database for a countdown function. But this function is not stable as it sometimes dosent actually wait before launching next line...
5
by: Jeremy | last post by:
Hi all, I have database actions that will potentially take several seconds to complete. My normal page uses AJAX so keeping the user informed of what is happening is not a problem. ...
2
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, i have a key up javascript function where i want half the function to run and then wait about 2 seconds, but if within that 2 seconds another key up event has a occurred, i need it to...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.