Home  >  Article  >  Web Front-end  >  js popup confirmation cancel dialog box

js popup confirmation cancel dialog box

高洛峰
高洛峰Original
2016-12-17 14:07:311544browse

一种:
<a href="javascript:if(confirm(&#39;确实要删除该内容吗?&#39;))location=&#39;http://www.google.com&#39;">弹出窗口</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(&#39;你确定要取消交易吗?&#39;)){
                 //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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn