473,734 Members | 2,647 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

need a sequential number generator in javascript

1 New Member
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.co m 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 11113
acoder
16,027 Recognized Expert Moderator MVP
See the setInterval method.
Jun 8 '07 #2
mad genius
3 New Member
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
1694
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. I want one that if the number picked is 0 through 99 it is generated as 000 through 099. Can anyone help me with this? Cause I'm stumpt.
2
2623
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 example: Call up the variable the first time: ordernumber = 1 "Reopen" the webpage, call up the variable a second time: ordernumber = 2, etc.
3
3174
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 finished (at the begining I have about 2500 objects in the unit, after the first acces I have 2499, then 2435, then 1720 and so on). The problem is that sometimes after a whole sequence the number of objects in the unit remains unchanged. After...
0
3011
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 someone helps me. Thanks!! ----------------------------------------------------------------------- The code for the Stock class: ----------------------------------------------------------------------- public class Stock { private Deck deck = new...
0
2837
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 java.util.*; import java.awt.*; /** * The Stock is the deck of unused cards. It is subtly different from the deck * itself in several ways. Firstly, it does not come into existence until after * the four cards have been extracted from the...
9
16765
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 random result from generate button : 10016486 + 22423 = 10038909 10038909 + 22423 = 10061332 and so on, maximum to 99999985 or if somebody can convert below c++ code to working javascript/html random number generator. #include <cstdlib> #include...
0
1245
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 dependents, martial status and a dollar amount which is a deduction for the company 401k plan. part one of the program allows one to add employee to the sequential file. part two of the program reads the sequential file, and for the each employee, ask for...
4
1052
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 --------------------------- A Runtime Error has occurred. Do you wish to Debug?
26
266
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 integer-values only (32 or 64 bit), no floating point. - The RNG should have passed some statistical tests. - The "RAND_MAX" of these generators should equal the period. - The LCG should of course generate each number only once in a period.
0
8946
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8776
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9310
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9236
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9182
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8186
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.