Counter (like McDonalds, Not Web Visitors)

G

Guest

The web sites I design have a goal of producing new business leads for my
clients (via a form on their web sites). I know everyday my company generates
5 new leads for our clients. I would like to get a script for a counter to
put on my web site that changes one digit every few hours. In other words,
today you would go to my site and it would say, "Number of New Business Leads
Generated" with a counter that says, 1074. Tomorrow you might visit it would
have changed to 1079, and so on.

Anyone know where I can get a script that create such a counter?
 
P

p c

One way: use a count up routine. You can do it with javascript on the
client or whatever script is supported onthe server, on the server.

For example, ussing javascript, look at the example and the source code
at this page:
http://www.jdstiles.com/java/countup.html

In you custom code, pick a starting numbeer of leads, say 1000 leads,
and a starting date. To simplify the proces, make the change based on
the dates since the starting date, at 5 new leads per day.

Then this line of code woult print the updated number of leads:

document.write("Number of New Business Leads Generated <b>"+ 1000 +
difference*5 +" </B>!)

To make it fancy, you can add style to number, box borders, diffrent
color etc..

...PC
 
G

Guest

Thanks. I'm not the good with code and could not get it correct. Knowing what
I want, can you fill in the blanks?

<script>
// This script came from
// Uncle Jim's Javascript Examples
// JDStiles.com

var montharray=new
Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")

function countup(yr,m,d){
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy
var paststring=montharray[m-1]+" "+d+", "+yr
var
difference=(Math.round((Date.parse(todaystring)-Date.parse(paststring))/(24*60*60*1000))*1)
difference+=" days"
document.write("Our servers have been up for<B> "+difference+" </B>!")
}
//enter the count up date using the format year/month/day
countup(2000,05,15)
</script>
 
P

p c

Ok here it is.

In the HTML view, copy this btween the ehad tags

<script type="text/javascript">
// This script came from
// Uncle Jim's Javascript Examples
// JDStiles.com

var montharray=new
Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")

function countup(yr,m,d,startLeads){
//enter the count up date using the format year/month/day
//startLeads is number of initial leads on start day
var today=new Date();
var todayy=today.getYear();
if (todayy < 1000)
todayy+=1900;
var todaym=today.getMonth();
var todayd=today.getDate();
var todaystring=montharray[todaym]+" "+todayd+", "+todayy;
var paststring=montharray[m-1]+" "+d+", "+yr;
var
difference=(Math.round((Date.parse(todaystring)-Date.parse(paststring))/(24*60*60*1000))*1);
var leads=startLeads+ difference*5;
document.write("Number of New Business Leads Generated <b>"+ leads +"
</b>!");
}

</script>

Then copy the following where you want the message to appear.

<script type="text/javascript">
//enter the count up date using the format year/month/day
//next pramters is starting value
countup(2005,10,1,1000);
</script>

Change the parameters of the function to correspond to what you want.
Change the document.write lien if you want different style.

...PC

Gregg wrote:
 
G

Guest

Thanks so much, but nothing is showing up (perhaps you can look at the source
code): http://www.salesimaging.com/counter.htm

p c said:
Ok here it is.

In the HTML view, copy this btween the ehad tags

<script type="text/javascript">
// This script came from
// Uncle Jim's Javascript Examples
// JDStiles.com

var montharray=new
Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")

function countup(yr,m,d,startLeads){
//enter the count up date using the format year/month/day
//startLeads is number of initial leads on start day
var today=new Date();
var todayy=today.getYear();
if (todayy < 1000)
todayy+=1900;
var todaym=today.getMonth();
var todayd=today.getDate();
var todaystring=montharray[todaym]+" "+todayd+", "+todayy;
var paststring=montharray[m-1]+" "+d+", "+yr;
var
difference=(Math.round((Date.parse(todaystring)-Date.parse(paststring))/(24*60*60*1000))*1);
var leads=startLeads+ difference*5;
document.write("Number of New Business Leads Generated <b>"+ leads +"
</b>!");
}

</script>

Then copy the following where you want the message to appear.

<script type="text/javascript">
//enter the count up date using the format year/month/day
//next pramters is starting value
countup(2005,10,1,1000);
</script>

Change the parameters of the function to correspond to what you want.
Change the document.write lien if you want different style.

...PC

Gregg wrote:

Thanks. I'm not the good with code and could not get it correct. Knowing what
I want, can you fill in the blanks?
 
P

p c

The code is broken due to line wrap. Make this "line" into a single line
in the page.

document.write("Number of New Business Leads Generated <b>"+ leads +
"</b>!");

Also look elsewhere, if that doesn't fix it.

...PC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top