<a onclick="TipMsg()" href="http://123">123</a>
<script>
function TipMsg()
{
   event.returnValue= confirm("真的浏览网站吗?");
}
</script>

解决方案 »

  1.   

    如果你说的是调用的是java函数,那是不行的。
    如果是javascript函数,那还是可以。
    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>New Page 1</title>
    </head>
    <script language="javascript">
    function TipMsg()
    {
       return confirm("真的浏览网站吗?");
    }</script>
    <body>
    <a href="www.sohu.com" onclick="if(!TipMsg()) return false;" >aaaa</a></body></html>
      

  2.   

    <a href="http://www.sohu.com" onclick='return confirm("真的浏览网站吗?")'">sohu</a>
      

  3.   

    <script language=javascript>
    TipMsg()
    {
       return confirm("真的浏览网站吗?"));
    }
    </script>
    <a href="www.sohu.com" onclick= "return TipMsg" >
      

  4.   

    不好意思,上贴有问题。这个正确:<script language=javascript>
    function TipMsg()
    {
    return confirm("真的浏览网站吗?");  
    }
    </script>
    <a href="www.sohu.com" onclick= "javascript:return TipMsg();" >asdf</a>