S
scuniverse
Hi,
I've looking to a solution to this problem but it seems there's none
to it, or if there's one I'm yet to find it.
Interesting enough the setTimeout issues and FF seem to go back to FF
1.x, they are fixed or so it seems but I have FF 2.0.0.11 and I have
the same good old flicker, it works fine under IE...
Here my problem I have a page with an .x3d object (validates xhtml 1.1
on the W3C) and a Javascript clock that is updated every second, the
problem is that the .x3d player (Flux player plugin for FF) flicks
every time the javascript clock updates, it's more annoying than
really painless but if I can fix it all the merrier.
Is there any other way to make a clock that will update every second
without setTimeout ?
//Function Time
function t() {
var bxx = document.getElementById('stime');
stoday = pp;
intH = stoday.getHours();
intM = stoday.getMinutes();
intS = stoday.getSeconds();
if (intH < 10) {
h = "0"+intH;
}else{h = intH;}
if (intM < 10) {
m = "0"+intM;
}else{m = intM;}
if (intS < 10) {
s = "0"+intS;
}else{s = intS;}
bxx.innerHTML=h+":"+m+":"+s;
stoday.setTime(stoday.getTime()+1000);
var ltime = document.getElementById('ltime');
today = new Date();
intHours = today.getHours();
intMinutes = today.getMinutes();
intSeconds = today.getSeconds();
if (intHours < 10) {
Hours = "0"+intHours;
}else{Hours = intHours;}
if (intMinutes < 10) {
minutes = "0"+intMinutes;
}else{minutes = intMinutes;}
if (intSeconds < 10) {
seconds = "0"+intSeconds;
}else{seconds = intSeconds;}
timeString = Hours+":"+minutes+":"+seconds;
ltime.innerHTML = timeString;
window.setTimeout("t();", 1000);
}
And here are the lines where the 2 "times" are shown:
<span class="topic_1">Local Time:</span>
<div id="ltime">0</div>
<span class="topic_1">Server Time:</span>
<div id="stime">0</div>
<script type="text/javascript"> pp=new
Date(2008,01-1,03,21,55,54);t();</script>
The new date is given by a PHP call and it's the server time.
This is the webpage I speak of,
http://game.scuniverse.net/3d_populated.php
Thanks for your time
Marco
PS: If anything looks bad on my Javascript don't restrain yourself
from saying it
I've looking to a solution to this problem but it seems there's none
to it, or if there's one I'm yet to find it.
Interesting enough the setTimeout issues and FF seem to go back to FF
1.x, they are fixed or so it seems but I have FF 2.0.0.11 and I have
the same good old flicker, it works fine under IE...
Here my problem I have a page with an .x3d object (validates xhtml 1.1
on the W3C) and a Javascript clock that is updated every second, the
problem is that the .x3d player (Flux player plugin for FF) flicks
every time the javascript clock updates, it's more annoying than
really painless but if I can fix it all the merrier.
Is there any other way to make a clock that will update every second
without setTimeout ?
//Function Time
function t() {
var bxx = document.getElementById('stime');
stoday = pp;
intH = stoday.getHours();
intM = stoday.getMinutes();
intS = stoday.getSeconds();
if (intH < 10) {
h = "0"+intH;
}else{h = intH;}
if (intM < 10) {
m = "0"+intM;
}else{m = intM;}
if (intS < 10) {
s = "0"+intS;
}else{s = intS;}
bxx.innerHTML=h+":"+m+":"+s;
stoday.setTime(stoday.getTime()+1000);
var ltime = document.getElementById('ltime');
today = new Date();
intHours = today.getHours();
intMinutes = today.getMinutes();
intSeconds = today.getSeconds();
if (intHours < 10) {
Hours = "0"+intHours;
}else{Hours = intHours;}
if (intMinutes < 10) {
minutes = "0"+intMinutes;
}else{minutes = intMinutes;}
if (intSeconds < 10) {
seconds = "0"+intSeconds;
}else{seconds = intSeconds;}
timeString = Hours+":"+minutes+":"+seconds;
ltime.innerHTML = timeString;
window.setTimeout("t();", 1000);
}
And here are the lines where the 2 "times" are shown:
<span class="topic_1">Local Time:</span>
<div id="ltime">0</div>
<span class="topic_1">Server Time:</span>
<div id="stime">0</div>
<script type="text/javascript"> pp=new
Date(2008,01-1,03,21,55,54);t();</script>
The new date is given by a PHP call and it's the server time.
This is the webpage I speak of,
http://game.scuniverse.net/3d_populated.php
Thanks for your time
Marco
PS: If anything looks bad on my Javascript don't restrain yourself
from saying it