473,408 Members | 2,087 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,408 software developers and data experts.

need a sequential number generator in javascript

1
I was on the web trying to find a javascript that would allow me to input a number on my website and have it increase by a given percentage every second.

During my search I found the Earth Population Calculator on the javascripkit.com site. The Calculator functions just as I imagine I want my number generator to function, but I need it to present a different number.

I work for a non profit organization that administers Head Start and other federal and state social service programs. We would like to put a counter on our website that shows the total dollars saved nationally as a result of the services agencies such as ours provide to children and parents from low-income families. For example, (for the moment I’m guessing at these numbers) let’s say that up to this point in time, $5,000,000 has been saved, and every second after that another $500 is saved.

Could anyone help me by telling me how to create a javascript that could be allow me to input the starting number ($5,000,000) and also inputting the number I need it to increase by per second? Once I get the starting number in, and the increase per second, I want it to continue running without any further input, just as the Earth Population Calculator does.

I’ve spent the past few days searching the internet for an answer to my problem but haven’t been able to find a sequential number generator.The Earth Population Calculator is the closest thing I’ve been able to find that demonstrates what I need.

We are using FrontPage for our web development, but I have a new site I’ve created using Dreamweaver that I hope to be able to replace the FrontPage site with soon.

I would really appreciate any help you can give me.

Thank you,
masker
Jun 7 '07 #1
2 11092
acoder
16,027 Expert Mod 8TB
See the setInterval method.
Jun 8 '07 #2
It is a simple program:
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. var numat = 5000000
  5.  
  6. function numberchange(){
  7.     numat += 500
  8.     document.getElementById("numspace").innerHTML = "$" + numat + " Saved"
  9.     setTimeout("numberchange()",1000)
  10. }
  11. </script>
  12. </head>
  13. <body onLoad="setTimeout('numberchange()',1000)">
  14. <div id="numspace">$5000000 Saved</div>
  15. </body>
  16. </html>
Jan 27 '11 #3

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

Similar topics

3
by: Jules | last post by:
I've searched high and low for a 3 digit number generator that will pick at random a number between 000 and 999. The only things I have found were generators that pick numbers from 0 to 999. ...
2
by: Ken | last post by:
This is a challenge. Perhaps someone can offer suggestions. I am trying to create a variable, ordernumber, that increases by an increment of 1 every time the variable is accessed. For...
3
by: Sigmathaar | last post by:
Hi, I'm need some advice about lists and vectors. I'm doing a program who needs to have sequential access of a non ordered unit of objects whose size decreases almost each time the sequence is...
0
by: Limpor | last post by:
Hello, I am new to learning java, and i am trying to build the class for a calculation card game, unfortunately i can't get the public Card top() and Card takeTop() method in the Stock class. Can...
0
by: Limpor | last post by:
Hi, I’m working on a solitaire game as my course assignment, and I am having trouble to dealing with Stock class, which consists of an upturned top card plus deck. The code for Stock class: import...
9
by: L33VaNcL33F | last post by:
I like to make a javascript that generate random number from the range number within : (10016486 and 99999985). the number always + 22423 that begin from 10016486 and end at 99999985 Example...
0
by: RENEE | last post by:
I Need help writing a program that will process payroll for small company with 26 employess, needs to store all employee name in sequential file along with address info, pay rate, number of...
4
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, i have a simple user control that has a button on it which is on my web page. everytime i click it i get the following message: --------------------------- Error...
26
by: Adem24 | last post by:
I need a good and fast random number generator (RNG), and a linear congruential generator (LCG), both with a max period >= 31 bits; the bigger the better. Additional requirements: - Must use ...
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: 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
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
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...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.