解决方案 »

  1.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title><script type="text/javascript">
    window.onload=function(){
    var a=document.getElementById('test');
    var num=0;
    var p=null;
    a.onclick=function(e){
    var a=e||window.event;
    if(a.preventDefault){
    a.preventDefault();
    }else{
    a.returnValue=false;
    }
    num++;
    if(num==1){
    p=window.setTimeout(function(){
    window.location.href='http://www.baidu.com';
    },2000);
    }else if(num==2){
    if(p){
    window.clearTimeout(p);
    p=null;
    window.location.href='http://www.hao123.com';
    }
    }
    }
    }
    </script>
    </head><body>
    <a id="test">test</a>
    </body>
    </html>ie7 ie8两次单击需要间隔一秒左右的时间  好像
      

  2.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title><script type="text/javascript">
    window.onload=function(){
    var a=document.getElementById('test');
    var num=0;
    var p=null;
    a.ondblclick=function(){
    window.location.href='http://www.hao123.com';
    }
    a.onclick=function(e){

    var a=e||window.event;
    if(a.preventDefault){
    a.preventDefault();
    }else{
    a.returnValue=false;
    }
    num++;
    if(num==1){
    p=window.setTimeout(function(){
    window.location.href='http://www.baidu.com';
    },500);
    }else if(num==2){
    if(p){
    window.clearTimeout(p);
    p=null;
    }
    window.location.href='http://www.hao123.com';
    }
    }
    }
    </script>
    </head><body>
    <a id="test">test</a>
    </body>
    </html>修改了下