Browsed Time Problem.
Posted
by aamir Fayyaz
on Stack Overflow
See other posts from Stack Overflow
or by aamir Fayyaz
Published on 2010-06-12T05:05:55Z
Indexed on
2010/06/12
5:12 UTC
Read the original article
Hit count: 163
php
|JavaScript
I want to display the browsed time of a user, But when i refresh it, it will be again start from 0:0:0. How can it handle?
<?php
$total_mints=($live_match['match_name']) * (60);
?>
<script language="javascript">
display_c(<?=$total_mints?>,'ct');
</script>
<script type="text/javascript">
function display_c(start,div){
window.start = parseFloat(start);
var end = 0 // change this to stop the counter at a higher value
var refresh=1000; // Refresh rate in milli seconds
if(window.start >= end ){
mytime=setTimeout("display_ct('"+div+"')",refresh)
}
else {alert("Time Over ");}
</script>
© Stack Overflow or respective owner