html - Using the same Javascript in different cells to count passed days -


I presently show counters from one count of past to each other to fill an HTML table I am trying. Thanks for the internet, I ended up with this script:

  & lt; Script language = "javascript 1.2" type = "text / javascript" & gt; Function SetCountUp (Inhares, Themanth, The Day) {Yr = theyear; Mo = themonth; Da = theday} ////////// Confucian countup script HERE ////////////////// STEP 1: Date, format year, month, day count Configure the date: // This date should be less than the setconvert (2012 9, 19) / Step 2: Configure the text to display the up var displaymessage = "" // STEP 3: width, height, Configure 5 variables below to determine the background color, and the text style of the counterparty area var countupwidth = '90%' var countupheight = '40px' // only in NS4 var Agu Countupbgcolor = '' var opentags = '& lt; Font face = "wordana" & gt; & Lt; Large & gt; Var Collites = '& lt; / Large & gt; & Lt; / Font & gt; ////////// Do not edit PASS this line ////////////////// var montharray = New Array ("Jan", "Fur", " Var crosscount = '' function start_ countup () "March", "April", "May", "June", "July", "August", "September", "Oct", "Nov", "Dec") If (Document.layers) document.countupnsmain.visibility = "show" else if (document.all = document.getElementById) crosscount = document.getElementById & amp; Amp; !! Document.all? Document.getElementById ("countupie"): countupie countup ()} if (document.all = document.getElementById) document.write ('& lt; span id = "countupie" style = "width:' + countupwidth + '; Background-color: '+ countupbgcolor +' "& gt; & lt; / span & gt; ') window.onload = start_countup function countup () {var today = new date () var todayy = today.getYear () if ( Today & lt; 1000) todayy + 1900 var todaym = today.getMonth () var todayd = today.getDate () var today = today.getHours () var todaymin = today.getMinutes () today todaysec = today. GetSeconds () var todaystring = montharray [todaym] + "+ nowadays +", today + today + + +: "+ + + + +": "+ Nowadays paststring = month [mo -1] + + + + + + + + + ", + Yr paststring =" 10:00 "+ month later [moe -1] +" + + + "," + yr dd = date PRSE (String today) - Datacres (paststring) dday = Math.floor (dd / (60 * 60 * 1000 * 24) * 1) dhour = Math Floor ((DD% (60 * 60 * 1000 * 24)) / (60 * 60 * 1000) * 1) dmin = Math.floor ((dd% (60 * 60 * 1000 * 24))% (60 * 60 * 1000)) / (60 * 1000) * 1) DSEC = M% (60 * 60 * 1000 * 24))% (60 * 60 * 1000))% (60 * 1000)) / 1000 * 1) Document. Player) {document.countupnsmain .document.countupnssub.document.write (opentags + dday + "days" + displaymessage + closetags) // To get more details, enter one of the following in the writing line (second ): + Dhour + "hours," + Dmin + "minutes, and" + dsec + "seconds" document.countupnsmain.document.countupnssub.document.close ()} and if (document.all) document.getElementById ) Crosscount.innerHTML = opentags + dday + "days" + displaymessage + closetags // + dhour + "hours," + dmin + "min , And "+ dsec +" seconds "setTimeout (" countup () ", 1000)} & lt; / Script & gt;  

Now, each cell line has a counter for a different event. I just seem to be unable to put this code in each, because it creates a conflict (I think)

I am completely new on this, and I have to solve it Can you help me, or can you tell me in the right direction?

Thank you in advance

I used to code Have a great time to achieve, and I have to say, this is a very bad code. It has a lot of unnecessary code:

  paststring = montharray [mo-1] + + "+ Da +", "+ yr paststring =" 10:00 "+ month [mo -1] +" + + + + ", + + Yr  

and very common formatting Madness. I believe I had done this work and it was easy to read as much as it was. This Bella should help you do your work.


Comments