就是先click在 执行 href

解决方案 »

  1.   

    本来就是先click 再跳转的呀
    <a href="http://www.qq.com/" onclick="fnGo(this)">111</a>
    <script>
    function fnGo(obj){
    obj.setAttribute("href","http://www.163.com/");
    }
    </script>
      

  2.   

    <a onclick="return a()" href="http://xxx">挑</a>
    a方法里return false;就不会跳转了
      

  3.   


    <a id="hrefId" href="JavaScript:method()">挑</a>
    <script>
          function method(){
             a();
             document.getElementById("hrefId").setAttribute("href","www.xxx.com"); 
          
     }
    </script>
      

  4.   

    本来就是先click 在跳转
    click return fase;不跳转