zoukankan      html  css  js  c++  java
  • 关于如何在.aspx页面用javaScript实现点按钮弹出确认提示窗口

    //JavaScript js弹出确认消息框判断是否删除,删除前提示用户是否删除,点是删除,点否返回  
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">  
    <HTML>  
    <HEAD>  
    <TITLE>黑色头发</TITLE>  
    <META NAME="Generator" CONTENT="EditPlus">  
    <META NAME="Author" CONTENT="">  
    <META NAME="Keywords" CONTENT="">  
    <META NAME="Description" CONTENT="">  
    </HEAD>  
      
    <BODY>  
    <a href="http://heisetoufa.iteye.com" onclick="return confirm('确定将此记录删除?')">删除</a>  
    </BODY>  
    </HTML>
    //JavaScript 实现关闭网页弹出确认窗口提示
    <html>
    <head>
    <title>烈火网-确认关闭页面提示窗口</title>
    <meta http-equiv="content-Type" content="text/html;charset=gb2312">
    </head>
    <!--把下面代码加到<body>与</body>之间-->
    <body onbeforeunload="event.returnValue='你的页面数据尚未保存,确定退出烈火网吗?';">
    关闭窗口试试!
    <br /><center>如不能显示效果,请按Ctrl+F5刷新本页,更多网页代码:<a href='http://www.veryhuo.com/' target='_blank'>http://www.veryhuo.com/</a></center>
    </body>
    </html>
    //Javascript删除数据时的确认对话框,用到了confirm函数,注意后边的location里应填入当你选择确认时需要执行的网页,可以带上参数,也就是此例中的网址处 
    <title>Javascript删除确认对话框</title>
    <a href='javascript:if(confirm("你确认要删除吗?"))location="/"'>删除</a>
    //JavaScript点击按钮显示确认对话框
    <html xmlns="http://www.w3.org/1999/xhtml">  
    <head>  
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />  
    <title>My First Script</title>  
    <script type="text/javascript">  
    function test() {  
        var result = confirm("Please make sure.");  
        if (result == true) {  
            alert("You choose YES! Great!");  
        } else {  
            alert("What a bitch you are !");  
        }  
    }  
    </script>  
    </head>  
    <body>  
        <input type="button" value="Click Me!" onClick="test();" />  
    </body>  
    </html>  
  • 相关阅读:
    条形码分类
    ubuntu下配置j2ee开发环境——sunjdk1.6的安装
    折腾的这几天
    Windows Phone 8 开发环境搭建
    Windows Phone SDK 8.0的安装软硬件配置要求
    ubuntu连接无线网遇到的错误和解决思路总结(无具体过程)
    解析html标签并转化成图片
    javaIO的类备忘
    ubuntu下配置j2ee开发环境——sunjdk1.7的配置
    Jmeter之JDBC Request及参数化
  • 原文地址:https://www.cnblogs.com/weicleer/p/2786339.html
Copyright © 2011-2022 走看看