一种: <a href="javascript:if(confirm('确实要删除该内容吗?'))location='http://www.google.com'">弹出窗口</a> 二种: <script language="JavaScript"> function delete_confirm(e) { if (event.srcElement.outerText == "删除") { event.returnValue = confirm("删除是不可恢复的,你确认要删除吗?"); } } document.onclick = delete_confirm; </script> <a href="Delete.aspx" onClick="delete_confirm">删除</a> 三种: if(window.confirm('你确定要取消交易吗?')){ //alert("确定"); return true; }else{ //alert("取消"); return false; } 四种: <script language="JavaScript"> function delete_confirm() <!--调用方法--> { event.returnValue = confirm("删除是不可恢复的,你确认要删除吗?"); } </script>
For more js pop-up confirmation and cancel dialog boxes, please pay attention to the PHP Chinese website for related articles!