不行吧,不然alert就不是alert了。用楼上的方法吧。
解决方案 »
- 简单的javascript问题,求大神解答
- 求助eval解析json,然后getElementById的问题
- EditorGridPanel 中的TriggerField 怎么将值返回给grid的列id???
- javascript如何判断页面是刷新还是跳转还是关闭?
- Extjs 引入太慢了
- jsp验证多组单选表单是否都选,没有选择的提示当前所有未选项,急!
- 请问在javascript中怎么把另一个页面的内容全部输出到本页面中??
- 请问怎么样能够让窗口始终不关闭?
- 怎么样用JS开发标签页切换的效果?
- 萌新求教:js文件一加入import语句就报错
- javascript有没有象vs.net那样快速开发功能强大的开发环境或工具
- 很简单,就是不懂。一个获取函数值的问题
---------
<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>
web有web的特点,没有必要非的去模仿cs程序