alin19 Posted February 12, 2008 Share Posted February 12, 2008 <script language="JavaScript"> <!-- var clockID = 0; function Update() { var x=0; document.write(x); var x=x+1; clockID = setTimeout("Update()", 100); } //--> </script> <body onload="Update()"> </body> Link to comment https://forums.phpfreaks.com/topic/90763-what-im-making-wrong/ Share on other sites More sharing options...
nogray Posted February 12, 2008 Share Posted February 12, 2008 define the x outside the function var x=0; function Update() { document.write(x); x++; clockID = setTimeout("Update()", 100); } Link to comment https://forums.phpfreaks.com/topic/90763-what-im-making-wrong/#findComment-465293 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.