function test(){
    document.getElementById("ok").setAttribute("href",'TopChainPrint://4.2.01.019');
    document.getElementById("ok").click();
}
setInterval("test()",5000);
上面代码,在IE和火狐上都可以正常,每5秒调用一次应该程序,但在chrome浏览器上,竟然只调用一次,有没有谁遇到过,这问题困扰我几天了,求指导!非常感谢!

解决方案 »

  1.   

    http://topic.csdn.net/u/20120827/17/791ab725-342f-4a45-9661-a2dd0b61db4d.html
      

  2.   

    http://topic.csdn.net/u/20120827/17/791ab725-342f-4a45-9661-a2dd0b61db4d.html
      

  3.   

    是不是你document.getElementById("ok").click();这句代码出错了,导致一直没执行。document.getElementById("ok").click();你定义过了?要不在firefox下应该会出错吧
      

  4.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
     <head>
      <title> New Document </title>
      <meta name="Generator" content="EditPlus">
      <meta name="Author" content="">
      <meta name="Keywords" content="">
      <meta name="Description" content="">
     </head>
     <script type="text/javascript">
     function test(){alert(1);
      document.getElementById("ok").setAttribute("href",'www.baidu.com');
      document.getElementById("ok").click();
    }
     
    function lode() {setInterval("test()",500000);}
     </script>
     <body  onload="lode()">
      <span id="ok">OK</span> </body>
    </html>
      

  5.   

    document.getElementById("ok").click() 定义过了,而且在chrome上也能调用到一次
      

  6.   

    4楼的你好,span 标签没有href属性