如何让JS时钟,在有alert弹出的时候继续运行
多线程?
有没有人知道,alert弹出的时候不阻塞JS的方法

解决方案 »

  1.   

    模拟模态框。http://www.never-online.net/blog/article.asp?id=22
      

  2.   

    JK的CODE:<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>
      

  3.   

    购买虚拟主机送域名 安全稳定!
    1. 火爆推出:1个国际/国内域名+100M网页空间+企业邮局,惊爆价188元/年。
    详情登陆网站 http://deidc.com/services/special1. 火惊爆价: 200M网页空间 118元/年。
    了解详情登陆中频网站 http://deidc.com/Services/Hosting/popularity.aspDNN虚拟主机
    http://www.deidc.com/Services/Hosting/dnn.aspcoldfusion虚拟主机,支持.CFM 和.CFC,coldfusion7.0
    http://www.deidc.com/Services/Hosting/coldfusion.aspASP.net2.0虚拟主机,送SQL数据库
    http://www.deidc.com/Services/Hosting/business.aspFlash Remoting for .NET虚拟主机
    http://www.deidc.com/Services/Hosting/Flash_Remoting.asp
    网页制作免费教程站 http://homepage.deidc.com