Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2006
    Thanked 0 Times in 0 Posts

    javescript help for firefox

    i have this code that tell a user how long they have been on the site at the bottom of the window.
           <script type="text/javascript">
     function setOnlineTime()
     now = new Date();
     diff = Math.floor((now.getTime()-starttime)/1000);
     hours = Math.floor(diff/3600);
     mins = Math.floor(diff/60) % 60;
     secs = diff % 60;
     if (hours < 10)
     hours = "0"+hours;
     if (mins < 10)
     mins = "0"+mins;
     if (secs < 10)
     secs = "0"+secs;
     window.status = "Online time: " + hours + ":" + mins + ":" + secs;
     now = new Date();
     starttime = now.getTime();
    although it doesnt work in firefox only in IE, can someone help me tweak it so that it works in ff also

  • #2
    Regular Coder
    Join Date
    May 2005
    Thanked 0 Times in 0 Posts

    Question It does work in FF.

    There's nothing wrong with your script. It's working fine in FF.

    The problem is that your script probably doesn't have permission to change the status bar information.

    Open FF.
    Select "Options..." from the "Tools" menu.

    Click the "Content" tab.

    Make sure the "Enable JavaScript" option is checked.

    Click the "Advanced..." button next to the "Enable JavaScript" option.

    Make sure the "Change status bar text" option is checked.

    Click "OK" on both dialogs to close them, then re-load the page with the timer script.


    Posting Permissions

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