Template clock - working only with refresh

Results 1 to 4 of 4
  1. #1
    Account Upgraded | Title Enabled! epocal is offline
    MemberRank
    Jun 2012 Join Date
    inside MuServerLocation
    579Posts

    Template clock - working only with refresh

    Ok so this is the template clock :



    The problem is that it only works when I hit refresh, so if I stay on the website for 2 minutes it shows the same time and if I hit refresh page it shows the current time and after that its static.

    How can I make it work as a normal clock that doesn't need to be refreshed ?

    Here is the index of template if useful : Download index.php from Sendspace.com - send big files the easy way


    Thank you in advance !


  2. #2
    Alpha Member 2009x2014 is offline
    MemberRank
    Dec 2009 Join Date
    2,765Posts

    Re: Template clock - working only with refresh

    Take basic clock made in few mins xD

    all going to template index.php

    Code:
    <script>
    function doclock()
    {
    var fucknow=new Date();
    var ho=fucknow.getHours();
    var mi=fucknow.getMinutes();
    var se=fucknow.getSeconds();
    var mo = fucknow.getMonth()+1 ; 
    var da = fucknow.getDate() ; 
    var ye = fucknow.getFullYear()
    ho=boobs(ho);
    mi=boobs(mi);
    se=boobs(se);
    mo=boobs(mo);
    da=boobs(da);
    ye=boobs(ye);
    document.getElementById('clock').innerHTML=mo+" "+da+" "+ye+" "+ho+":"+mi+":"+se;
    t=setTimeout(function(){doclock()},999);
    }
    function boobs(ct)
    { if (ct<10)
    { ct="0" + ct; }
    return ct; }
    </script>
    & display by

    Code:
    <body onload="doclock()">
    <div id="clock"></div>
    Date/Time will be like - 07 04 2013 08:46:47

  3. #3
    Account Upgraded | Title Enabled! epocal is offline
    MemberRank
    Jun 2012 Join Date
    inside MuServerLocation
    579Posts

    Re: Template clock - working only with refresh

    Quote Originally Posted by 4FUNer View Post
    Take basic clock made in few mins xD

    all going to template index.php

    Code:
    <script>
    function doclock()
    {
    var fucknow=new Date();
    var ho=fucknow.getHours();
    var mi=fucknow.getMinutes();
    var se=fucknow.getSeconds();
    var mo = fucknow.getMonth()+1 ; 
    var da = fucknow.getDate() ; 
    var ye = fucknow.getFullYear()
    ho=boobs(ho);
    mi=boobs(mi);
    se=boobs(se);
    mo=boobs(mo);
    da=boobs(da);
    ye=boobs(ye);
    document.getElementById('clock').innerHTML=mo+" "+da+" "+ye+" "+ho+":"+mi+":"+se;
    t=setTimeout(function(){doclock()},999);
    }
    function boobs(ct)
    { if (ct<10)
    { ct="0" + ct; }
    return ct; }
    </script>
    & display by

    Code:
    <body onload="doclock()">
    <div id="clock"></div>
    Date/Time will be like - 07 04 2013 08:46:47
    If I add your script I get 2clocks :)) wtf ... and that one still not working ... I know I'm messing up something in index, there is my index attached to the first post of this threat, can you do the paste where it should be ? :P

    Thank you again !

  4. #4
    Alpha Member 2009x2014 is offline
    MemberRank
    Dec 2009 Join Date
    2,765Posts

    Re: Template clock - working only with refresh

    Cuz you should remove old one first ^^

    zzZzz lazy epo

    Download index.rar from Sendspace.com - send big files the easy way



Advertisement