不行吧,不然alert就不是alert了。用楼上的方法吧。

解决方案 »

  1.   

    肯定的回答你 不行可以用模拟 但很难模拟alert的线程挂起效果 跨框架 以及 位置自适应等效果 我也正在尽力模拟...
      

  2.   

    那用个showModalDialog来模拟,或者用Popup对象,估计就可以达到N秒后消失的效果了。
      

  3.   

    无实用意义,博君一哂
    ---------
    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>JK:支持民族工业,尽量少买X货</title>
    </head>
    <script language=javascript defer >function modelessAlert(msg)
    {
    msg=msg.replace(/"/g,"\\\"");
    msg=msg.replace(/\n/g,"\\n");
    window.showModelessDialog("javascript:alert(\""+msg+"\");window.close();","","status:no;resizable:no;help:no;dialogHeight:height:30px;dialogHeight:40px;");
    }function autoCloseAlert(msg,iMilliSeconds)
    {
    msg=msg.replace(/"/g,"\\\"");
    msg=msg.replace(/\n/g,"\\n");
    if0.showModelessDialog("javascript:alert(\""+msg+"\");window.close();","","status:no;resizable:no;help:no;dialogHeight:height:30px;dialogHeight:40px;");
       setTimeout("if0.location.reload();",iMilliSeconds);
    }var i=0;
    window.setInterval("aaaa.value=i++;",100);var msg="这个alert弹出来,后面的js还在运行。"
    modelessAlert(msg);
    </script><body>
    <iframe style="display:none" name=if0 ></iframe>
    <input name=aaaa><br>
    <input type=button value="modelessAlert (非模态alert)" onclick="modelessAlert('Good Morning!中国人+_)(*&^%$#@!');"><br>
    <input type=button value="autoCloseAlert (非模态自动关闭alert)" onclick="autoCloseAlert('Good Morning!中国人+_)(*&^%$#@!',1000);"><hr>
    注:用modelessDialog里的alert来实现alert,用更新dodelessDualog的父iframe来实现关闭alert</body>
    </html>
      

  4.   

    不需要,
    web有web的特点,没有必要非的去模仿cs程序