链接特效-需要确认的链接

——————————————————————

<script type="text/javascript">    
            //确认的链接函数
            function confirmOpen(link){
                //弹出提示框,要求用户确认
                if(confirm('您确认打开'+link+'吗?')){
                    return true;    //返回真
                }else{
                    return false;    //返回假
                }
            }

</script>   

——————————————————————

<body style="text-align:center">
       <a href="http://www.baidu.com" onclick="return(confirmOpen(this.href))">打开链接</a>
 </body>

——————————————————————

posted @ 2016-09-22 14:57  承载梦想-韩旭明  阅读(122)  评论(0编辑  收藏  举报