自定义alert/confirm窗口

1.

/*******************************************************

ttt.htm

*******************************************************/

<html>
    <head>
        <META   HTTP-EQUIV= "pragma "   CONTENT= "no-cache ">
        <META   HTTP-EQUIV= "Cache-Control "   CONTENT= "no-cache,   must-revalidate ">
        <META   HTTP-EQUIV= "expires "   CONTENT= "Mon,   23   Jan   1978   12:52:30   GMT ">
        <title> 标题 </title>
    </head>
    <body>
        <div   id=haha> </div>
        <center> <input   type=button   value=确定   οnclick= "window.close() "> </center>
    </body>
        <script   language=javascript>
        if   (window.dialogArguments   !=   null)
        {
            var   ww   =   window.dialogArguments;
            document.all.haha.innerHTML   =   ww.mm;
        }
        </script>
</html>

 

/*******************************************************

test.htm

*******************************************************/

<script language=javascript>

var   mm   =   " ";
window.alert   =   function(str)
{
    mm   =   str;   //提示的文本
    showModalDialog( 'ttt.htm ',   window,   'dialogWidth:   240px;   dialogHeight:   100px;   status:   no;   help:   no ');
}

window.alert("123456789");

</script>

 

/*******************************************************

其他注释

*******************************************************/

alert(msg);

var isConfirmed = confirm(msg);//确定返回true,取消返回false

var text = prompt('标题','请输入内容');//text为用户输入的值,默认为“请输入内容”

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值