<html:link href="blackBooks.do?method=delBook&ID=${b.bookId}"
onclick="dell()">删除</html:link>以上是程序的部分代码,链接做的是删除的操作,在javascript里怎么在弹出confirm提示框里选择否的时候,能阻止删除的操作,望高手指教,谢谢!

解决方案 »

  1.   

    onclick="return cofirm('删除?');"
      

  2.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    <script language=JavaScript>
      function del(){
       if (confirm('delete?')){
    location.href = "http://www.google.cn";

    }else{

    }
      }

    </script>
    </head>
    <body>
     <a href="javascript:del();">del</a>
    </body>
    </html>
      

  3.   

    <a href='querymanage3.jsp?deleteid=<%=Notice_Id%>' onclick="{if(confirm('确定删除选定的纪录吗?')){return true;}return false;}">删除</a>