有html框架 上面一个页面显示倒计时
下面的页面显示题目当倒计时为0时  提交下面的提交按钮  
注意 倒计时页面和提交表单的提交按钮在两个页面 

解决方案 »

  1.   

    你提供的信息太笼统了JavaScript : setTimeout
      

  2.   

    计时页面top.html<html><script>var time1;
    //调用时间更新
    UpdateTimer();function UpdateTimer()
    { time1 = window.setTimeout("UpdateTimer()", 1000);
    var leftTime = document.getElementById("time_span").innerHTML - 1; document.getElementById("time_span").innerHTML = leftTime;
    if(leftTime <= 0)
    {
    clearTimeout(time1); //调用main frame 提交form事件
    parent.main.submitForm();
    }
    }</script><span id="time_span">2</span></html>提交表单页面main.html<html>
    <body><form id="form1" >
    </form><script>function submitForm()
    {
    alert('提交了!');
    form1.submit();
    }
    </script>
    </body></html>主框架页面index.html <html>   
     <head> </head>   
     <body>   
     <iframe id="top" name="top" src="top.html" frameborder="1" border="0" marginwidth="0" marginheight="0">   
      <iframe id="main" name="main" src="main.html" frameborder="1" border="0" marginwidth="0" marginheight="0">   
     </body>   
     </html> 
      

  3.   

    主页面可以可以用IFRAME潜入多个子页面 然后 其中一个子页面用来计时。事件到了可以通过JS 调用 另一个页面的JS 从而使页面提交。
    基本写法
    子页面 调用parent.xxxx() 取到父亲窗口 
    document.frames(ObjectID) 得到子窗口
      

  4.   

    颜色不管用嘛~   设置好ID 就可以了  
    这句代码是关键~
    parent.main.submitForm();