View Full Version : javescript help for firefox

11-02-2006, 06:55 PM
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

11-02-2006, 09:44 PM
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.