Web Analytics Made Easy -
StatCounter code problems - CodingForum

Announcement

Collapse
No announcement yet.

code problems

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • code problems

    WTF did i do wrong when creating this script!!!!
    thanks!!! i am trying to make an online clock...i left the stuff above my code ou cause i know the problem isnt there... is there a debugger for JScript????

    <FORM NAME = "Tick">
    <INPUT TYPE = "Text" SIZE = "12" NAME = "Clock">
    </FORM>

    <SCRIPT LANGUAGE = "JavaScript1.2">

    function time()
    {
    var hand = new Date()
    var hours = hand.gethours()
    var minutes = hand.getminutes()
    var seconds = hand.getseconds()
    var dn = "AM"

    if (hours>12)
    {
    dn = "PM"

    hours = hours-12
    }

    if (hours == 0)
    hours = 12

    if (minutes<=9)
    minutes = "0"+minutes

    if (seconds<=9)
    seconds = "0"+seconds

    document.tick.clock.value = hours+ ":" +minutes+ ":" +seconds+ " " dn

    setTimeout = ("show()", 1000)
    show()
    }
    </SCRIPT>

    </HTML>

  • #2
    Your function is called time() and you call it like show() change one of them into the other and it should work
    I am the luckiest man in the world

    Comment


    • #3
      Other than that, if you plan on the function being called without user input, you need to call it outside the function, either through the onload command or right after your function end, in this case the '}' character.

      Guardian

      Comment

      Working...
      X