看confirm的返回值,若true就当前窗口中链接目标页面;
若false,当前页面

解决方案 »

  1.   

    if true 当前窗口中链接目标页面
    else
    当前页面 
      

  2.   

    <a href="somewhere.htm" onclick="return confirm('确定吗?')">somewhere</a>
      

  3.   

      谢谢,能不能写一下,我也使用confirm的true false 可是搞不定
      

  4.   

    例子如下:(^o^)(^o^)(^o^)(^o^)(^o^)(^o^)(^o^)(^o^)(^o^)(^o^)(^o^)(^o^)(^o^)(^o^)(^o^)(^o^)(^o^)(^o^)(^o^)(^o^)(^o^)<html>
    <head>
    <script>
    function test(){
    if (confirm("你想进入MM世界吗?"))
    window.open("http://lucky.myrice.com");
    else
    window.open("http://go.163.com/~colorweb");}
    </script>
    </head>
    <body>
    <a href="#" onclick="test()">点击这里进入MM世界!!</a>
    </body>
    </html>