JavaScript - Alerting Minute
Hello house,
How do you see this code, all i wanted is for the code to tell me when the count has completed 60secs = 1 minutes. Help me out... Code: <html> <head> <script language="javascript"> <!-- var c = 0 document.form1.t1.value = "" function count(){ document.form1.t1.value = c c = c + 1 setTimeout("count()",1000) while(c > 0){ if(c == 60){ var sec = c; if(sec == 60){ var minut = 1; alert(minut+"minute(s)") } } c++ } } //--> </script> </head> <body> <form name="form1"> <input type="text" size="20" name="t1"> <input type="button" value="start" onclick="count()"> </form> </body> </html> Similar TutorialsI need a code that will load multiple codes based on what minute it is. Example: If it's 12:31 it will load code A If it's 12:32 it will load code B (Lets just say there are only two codes) If it's 12:33 it will load code A If it's 12:34 it will load code B etc. I use to have this in a file somewhere, but over the course of the past few years I've misplaced it an am unable to find it. It would be much appreciated if I could get some help with this. Hi, every time I try and alert: [ { number:0, secondnumber:0 }, { number:2, secondnumber:1 }, { number:1, secondnumber:2 } ] it just shows [object object], [object object], [object object]. Why is this and what can I do to make the record be shown as it is above in an alert? Thanks. |