Home > Net >  Mother board page countdown function failure, can't find the label object
Mother board page countdown function failure, can't find the label object

Time:11-29

 & lt; Asp: Content ID="Content2 ContentPlaceHolderID"="ContentPlaceHolder1" runat="server" & gt; 
Var time=7200;
Var minutes;
Var seconds;
Var con;
The function showtime () {

Con=document. GetElementById (' & lt; % %=lab_sj. The ClientID & gt; ');
Minutes=parseInt (time/60);
60 seconds=time %;
time--;
Con. InnerHTML (minutes + ":" + seconds);
If (time==0) {
Window. The alert (" end test!" );
Window. The location. Href='https://bbs.csdn.net/student/default.aspx';
}
The else {
SetTimeout (" showtime () ", 1000);
}
}
</script>





Master page page, point button to start the countdown, with the document. The write tested first seconds can get id for the lab_sj object, immediately find next second object or object to null


Want to know the cause of the problem, and can have a solution, realize the master page page countdown function
  • Related