View Single Post
  #1 (permalink)  
Old Oct 10th, 2007, 20:26
magnetica magnetica is offline
Junior Member
Join Date: Apr 2007
Location: uk
Age: 20
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
set and clearInterval with if else

Can someone please tell me why the clearInterval() func is never called even though the var pl certainly hits 10.
Wierd
Code: Select all
 
<script type="text/javascript">
var flashObj = document.getElementById("gameJS"); 
var pl = 0;
 function showPercent(){
  
          pl++;
  
 }
if(pl == 10){
 
clearInterval();
}
else {
 setInterval("showPercent()",1000);
}
</script>
Reply With Quote