View Single Post
Old 05-29-2012, 11:43 PM   PM User | #9
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,210
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
GET RID of all the old DayCounter code!

ZAP all of this:
Code:
<script type="text/javascript">
/**********************************************************************************************
* Day Counter script by Praveen Lobo (http://PraveenLobo.com/techblog/javascript-counter-count-days/)
* This notice MUST stay intact(in both JS file and SCRIPT tag) for legal use.
* http://praveenlobo.com/blog/disclaimer/
**********************************************************************************************/
function DayCounter(initDate, id){
****this.beginDate = new Date(initDate);
****this.container = document.getElementById(id);
****this.calculate();
}
*
DayCounter.prototype.calculate=function(){
****var secDiff = Math.round(((new Date()) - this.beginDate)/1000);
****var nextUpdate = 86400 - (secDiff % 86400);
****var tmp = (tmp = secDiff/86400) < 1? 0 : Math.floor(tmp);
****var days = (tmp < 10 ? ("" + tmp) : tmp < 100 ? ("" + tmp) : tmp);
****this.container.innerHTML =
********"Day " + days ;
****var self = this;
****setTimeout(function(){self.calculate();}, (++nextUpdate*1000));
}
*
window.onload=function(){ new DayCounter('May 19, 2012 00:00:00', 'counter'); }
*
</script>
So long as it is in there, it will try to overwrite what my code is trying to do!
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote