SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    Always learning kigoobe's Avatar
    Join Date
    May 2004
    Location
    Paris
    Posts
    1,565
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    not working in firefox, ok in IE

    well i have a function like this - (external js file)

    Code:
    function funClock() {
    // code goes here ... then, 
    if (document.layers) {
    document.layers.clock.document.write(todaysdate+" » "+currenttime);
    document.layers.clock.document.close();
    }
    else if (document.all) {
    clock.innerHTML = todaysdate+" » "+movingtime;
    }
    setTimeout("funClock()", 1000)
    }
    window.onload = funClock;
    then, I am calling the same as -
    Code:
    <span id="clock"></span>
    Problem, works fine in IE, 7 as well as 6 and below, but not in FF. Nothing appears there in firefox.

    Any guess?

  2. #2
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    use

    Code:
    var clock = document.getElementById('clock');
    Then you can use

    Code:
    clock.innerHTML = todaysdate+" "+movingtime;


  3. #3
    Always learning kigoobe's Avatar
    Join Date
    May 2004
    Location
    Paris
    Posts
    1,565
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Added, but nothing is changing ...

    probably Firefox is trying to look for the clock in CSS, and something is getting messed ... not sure though ...


Bookmarks

Posting Permissions

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