日期:2014-05-16  浏览次数:20418 次

定时提交功能~~~高分相送
想做一个定时提交按钮,由于对JavaScript不了解,希望高手指点一下,有没有什么好的方法。
我的方法如下,就是在 <script       里面不知道如何调用后面的提交按钮~~

(我这里是想调用Button1的事件)


<head   runat= "server ">
        <title> 无标题页 </title>
</head>
<meta       http-equiv= "Content-Type "       content= "text/html;       charset=gb2312 ">      
       
    <script       language= "JavaScript ">      
    var       intLeft       =       15;       //       Seconds       until       navigation       occurs      
       
    function       leavePage()       {      
    if       (0       ==       intLeft)       //       Time       is       up--navigate.      
    alert( 'BOMB!!!哈哈!这里还可以换成超级连接。 ')       //       我的思路是在这一部分调用下面的提交按钮
    else       {      
    //       Count       down       and       output       updated       time       by      
    //       changing       the       contents       of       the       element.      
    intLeft       -=       1;      
    document.all.countdown.innerText       =       intLeft       +       "       ";      
    //       Wait       another       second.      
    setTimeout( "leavePage() ",       1000);      
    }      
    }      
    </script>      
<body         onLoad= "setTimeout( 'leavePage() ',       1000) ">
        <form   id= "form1 "   runat= "server ">
        <div>
        <span       id= "countdown ">       <!--       Output       initial       amount       of       time.       -->          
    <script       language= "JavaScript ">      
    document.write(intLeft);      
       
    </script>      
    </span>      
                欢迎你 <asp:Label   ID= "LabelName "   runat= "ser