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

setTimeout问题
ccc.jsp
<%@   page   contentType= "text/html;charset=GBK "%>

<html>
<head>
<script   language= "javascript ">
<!--
var   v_time_num=3;
var   ss=v_time_num;
function   lk_Log(){
    document.form1.t1.value   =   ss;
    if(ss==0   ){
          ss=v_time_num;  
          document.getElementById( "log_iframe ").src= "ddd.jsp "; log_iframe.log_form.submit();
      }
ss--;
setTimeout( "lk_Log() ",   1000); }
//-->
</script>
</head>
<body>
<form   name= "form1 "   >
<input   type= "text "   name= "t1 "   value= " "   />
</form>
<iframe   id= "log_iframe "   name= "log_iframe "   src= "ddd.jsp "     style= "display:none "   > </iframe>
</body>
<script> window.onload   =   lk_Log; </script>
</html>


ddd.jsp

<%@   page   contentType= "text/html;charset=GBK "%>

<html>
<head>
</head>
<%
System.out.println( "dddddddddddddddddddddddddddddd ");
out.println( " <script> location.href= 'ccc.jsp '; <script> ");
%>
</html>

我想在ccc.jsp页面计时,当时间到了0之后跳转到ddd.jsp进行打印,之后再回到ccc.jsp,继续计时。   现在当时间到0之后,跳转到ddd.jsp页面打印是成功的,但是之后就无法继续了,请指教下,谢谢了。

------解决方案--------------------
out.println( " <script> location.href= 'ccc.jsp '; <script> ");这里写错了吧
out.println( " <script> location.href= 'ccc.jsp '; </script> ");
------解决方案--------------------
貌似一低级错误