Local usageStorage with a Countdown script [closed]

1
<script type="text/javascript">
var sHors = "10"; 
var sMins = "00";
var sSecs = 00;

function getSecs(){
  sSecs--;
  if(sSecs<0){
    sSecs=59;sMins--;if(sMins<=9)sMins="0"+sMins;
    localStorage.setItem("sSecs", "tempo"); 
    localStorage.getItem("sSecs");
  }
  if(sMins=="0-1"){
    sMins=5;sHors--;if(sHors<=9)sHors="0"+sHors;
    localStorage.setItem("sHors", "tempo"); 
    localStorage.getItem("sHors");
  }
  if(sSecs<=9)sSecs="0"+sSecs;
  if(sHors=="0-1"){
  sHors="00";sMins="00";sSecs="00";
  clock1.innerHTML=sHors+"<font color=#000000>:</font>"+sMins+"<font color=#000000>:</font>"+sSecs;
  localStorage.setItem("sMins", "tempo"); 
  localStorage.getItem("sMins");
}else{
   clock1.innerHTML=sHors+"<font color=#000000>:</font>"+sMins+"<font color=#000000>:</font>"+sSecs;
    setTimeout('getSecs()',1000);
  }
}
// Fim countdown
</script>

I want to use localStorage to store information and prevent countdown from returning to zero for the whole public and always keep the same count for everyone, but I do not know what I'm doing wrong with this script! >     

asked by anonymous 13.12.2014 / 00:21

0 answers