window.onload=function(){setTimeout('Timer1_Timer',1000);};

解决方案 »

  1.   


    function Timer1_Timer(){
    Timer1.innerHTML=' <B>12 </B>';
    t=setTimeout('Timer1_Timer()',1000);
    }
    window.onload = function(){Timer1_Timer();}
      

  2.   

    <html>
    <head>
    <title></title>
    <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    </head>
    <body>
    <FONT face="宋体"></FONT>
    <span id="Timer1"></span>
    <script language=JavaScript>Timer1.innerHTML="<B>0</B>"; 
    window.onload=function(){setTimeout('Timer1_Timer',1000);};
    alert('OK');
    window.setInterval('Timer1_Timer',1000); 
    I=0;
    function Timer1_Timer(){
    alert(I);
    I++;
    Timer1.innerHTML='<B>'+I+'</B>';
    }
    </script>
    </body>
    </html>麻烦帮看下,为什么alert('OK')执行了,但是Timer1_Timer中的内容却没有任何执行?
      

  3.   


    <html>
    <head>
    <title></title>
    <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    </head>
    <body>
    <FONT face="宋体"></FONT>
    <span id="Timer1"></span>
    <script language=JavaScript>Timer1.innerHTML="<B>0</B>"; 
    window.onload=function(){setTimeout('Timer1_Timer',1000);};
    alert('OK');
    // window.setInterval('Timer1_Timer',1000); 
    I=0;
    function Timer1_Timer(){
    t=setTimeout('Timer1_Timer',1000)
    alert(I);
    I++;
    Timer1.innerHTML='<B>'+I+'</B>';
    }
    </script>
    </body>
    </html>这样也不行?
      

  4.   

    昏迷...
    你仔细看一下我在三楼回复的代码...
    哪里有在window.onload事件里直接设置延迟的?