Page 1 of 11
Archive - read only
uCause Community » Trash & Archives » Trash » World Population Counter
World Population Counter
DevilDate: Saturday, 2011-11-19, 11:02 PM | Message # 1
Member
Group: Senior Members
Messages: 55
Awards: 1
Reputation: 3
Status: :-(
Description: This script estimates the current population of the world using only math and displays the results live. It comes very close to the official estimates!

Code
<script type="text/javascript">

/*
* World Populution Counter - By JavaScript Kit (http://www.javascriptkit.com)
* Based on code by Adam Brown
* This notice MUST stay intact for use
* Visit JavaScript Kit (http://www.javascriptkit.com) for this script and more
*/

function maind(){
  startdate = new Date()
  now(startdate.getYear(),startdate.getMonth(),startdate.getDate(),startdate.getHours(),startdate.getMinutes(),startdate.getSeconds())
}

function ChangeValue(number,pv){
  numberstring =""
  var j=0  
  var i=0
  while (number > 1)
   {  

      numberstring = (Math.round(number-0.5) % 10) + numberstring
      number= number / 10
      j++
      if (number > 1 && j==3) {  
    numberstring = "," + numberstring  
    j=0}
      i++
   }

   numberstring=numberstring

if (pv==1) {document.getElementById("worldpop").innerHTML=numberstring }
}

function now(year,month,date,hours,minutes,seconds){        
startdatum = new Date(year,month,date,hours,minutes,seconds)

var now = 5600000000.0
var now2 = 5690000000.0
var groeipercentage = (now2 - now) / now *100
var groeiperseconde = (now * (groeipercentage/100))/365.0/24.0/60.0/60.0  
nu = new Date ()                 
schuldstartdatum = new Date (96,1,1)                             
secondenoppagina = (nu.getTime() - startdatum.getTime())/1000
totaleschuld= (nu.getTime() - schuldstartdatum.getTime())/1000*groeiperseconde + now
ChangeValue(totaleschuld,1);

timerID = setTimeout("now(startdatum.getYear(),startdatum.getMonth(),startdatum.getDate(),startdatum.getHours(),startdatum.getMinutes(),startdatum.get Seconds())",200)
}

window.onload=maind
</script>

Current world population (estimated): <span id="worldpop" style="font-weight: bold"></span>.

<p style="font: normal 11px Arial">This free script provided by<br />
<a href="http://www.javascriptkit.com">JavaScript Kit</a></p>
tags-zB11World, Population, Counter
 
0 Thanked you For This Useful Post:
SirDarknight(Tonmoy)Date: Sunday, 2011-11-20, 7:06 AM | Message # 2
Member
Group: Senior Members
Messages: 894
Awards: 10
Reputation: 15
Status: :-(
I've already posted this

Please Give Me A Award or + Rep If My Post Helps You

Please Give Me A Award or + Rep If You Like my Scripts
 
0 Thanked you For This Useful Post:
uCause Community » Trash & Archives » Trash » World Population Counter
Page 1 of 11
Search:


"Making uCoz web designs simple and easy to use"
- uCause Developers