www.webdeveloper.com
Results 1 to 2 of 2

Thread: Firefox Java Timer Script not working

  1. #1
    Join Date
    Jun 2012
    Location
    Dark Side of the Moon
    Posts
    70

    Firefox Java Timer Script not working

    Okay, I am running into an issue the the following script. This works in chrome and IE, but not in Firefox. I have the most updated version of java and fox, as well there are no errors or warnings, as well all other java works just fine, kinda odd, but I can't seem to figure it out. Any help on this would be great, I am aiming for IE, Fox, and Chrome compat. Thanks for your time.

    Code:
    var timeOut;
    
    function JSClock()
    {
    
        var now, time, app, hour, min, sec, ampm, size;
    
        now = new Date();
    
        hour = now.getHours(now.setHours(now.getHours() + 14));
    
        ampm = (hour >= 12) ? ' P.M.' : ' A.M.';
    
        if (hour > 12) { hour = hour - 12; }
    
        if (hour < 10) { hour = ' ' + hour; }
    
        min = now.getMinutes();
    
        if (min < 10) { min = '0' + min; }
    
        sec = now.getSeconds();
    
        if (sec < 10) { sec = '0' + sec; }
    
        time = hour + ':' + min + ':' + sec + ampm;
    
        document.getElementById("time").innerText = time;
    
        timeOut = setTimeout("JSClock()", 1000);
    
    }

  2. #2
    Join Date
    Jun 2012
    Location
    Dark Side of the Moon
    Posts
    70
    Alright, well I fixed it, seems fox doesn't support InnerText, but innerHTML worked just fine.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles