473,385 Members | 1,958 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,385 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 6004
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.