<body onlosd="doTimer()"> 这个能运行吗?<body onload="doTimer()"> 

解决方案 »

  1.   

    sorry 是
    body onload="doTimer()"> 
    笔误了
      

  2.   


    <script language="javascript"> 
    var the_timeout; 
    ase=new Array(); 
    ase[0]="file:///H|/piclib/a.jpg"; 
    ase[1]="file:///H|/piclib/b.jpg"; var i=0; function doTimer() 

       document.getElementById("img").src = ase[i];
       if(i==1) i=0;
       else i=1;
       if(!the_timeout) clearTimeout(the_timeout);
       the_timeout = setTimeout("doTimer();",3000); 

    </script> 
    </head> <body onload="doTimer()"> 
    <table width="100%" border="0" cellspacing="1"> 
       <tr> 
    <img src="" id="img">  
       </tr> 
    </table> 
    </body> 
    </html>