ttyp: 没听明白你的意思? 能说清楚一些吗?
解决方案 »
- Js删除TABLE行的问题
- 求js高手 写一个事件的例子
- 判断某单元格是表格的第几行
- 在IE8中使用window.open()丢失session的问题 急!!
- 脚本问题,去掉网页上面的帮助按钮?。。。
- JS小问题
- 怎么用Javascript指定div 左边框颜色呢?
- 如何用javascript的正则表达式将一个字符串的\r\n 的回车符 全部 替换成<br>的换行符呀
- 我才开始学习作web程序,其中看到很多的地方都用到了jsp,现在想学开如何入手>>>>>
- “没有权限”的问题(我的项目中一个重要的问题)
- 动态插入行的表格,如何添加行中的自定义属性
- 菜鸟提问!我在网上找到一个很好的JS时钟,但是放在页面上我没办法让它居中,因为我想把它写在html并iframe连接它.
要不是你写的,那就找个砝码把回车键按下去就可以了
要是你写的,我以前写过一个alert的程序,可以控制的,你试试看吧,代码如下:
<!--a.htm-->
<script language="JavaScript">
<!--
//alert();
function Alert(strText){
var pWin=window.showModalDialog("b.htm",strText,"dialogHeight:116px; dialogWidth:232px; help: No; resizable: no; status: No; scroll:no; dialogTop:"+(screen.height-116)/2+"px; dialogLeft:"+(screen.width-232)/2+"px;");
}
Alert("用户名非法!");
//-->
</script>
<!--b.htm--><html>
<head>
<style type="text/css">
body{ }
td,input{ font-size:12px}
</style>
<script language="JavaScript">
<!--
var str = window.dialogArguments;
function doOk(){
window.returnValue="";
window.close();}
//-->
</script>
<title align="center">--==提示信息==--</title>
</head>
<body style="background-color:buttonface; margin:0" >
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
<tr height="65%">
<td width="25%" align="center" valign="center"><img src="warning.gif" style="width:32px; height:32px"></td>
<td valign="middle">
<script language="JavaScript">
<!--
document.write(str);
//-->
</script>
</td>
</tr>
<tr height="35%">
<td colspan="2" align="center" valign="top">
<input type="button" id="btnOk" value=" 确定 " onclick="doOk()">
</td>
</tr>
</table>
</body>
<script language="JavaScript">
<!--
document.onclick=function (){
document.getElementById("btnOk").focus();
}
document.body.oncontextmenu=function (){
document.getElementById("btnOk").focus();
}
//-->
</script>
<html>图片传不上来,就是window系统里的图片,自己找找吧
---------
<iframe style="display:none" name=if0 ></iframe>
<input type=button value="autoRequest" onclick="autoRequest();"><br>
<script language=javascript >
function autoRequest()
{
if0.showModelessDialog("C:/Documents and Settings/Administrator.JK/Desktop/a1.html?a=1&b=2&c=3","","status:no;resizable:no;help:no;dialogHeight:height:30px;dialogHeight:40px;");
setTimeout("if0.location.reload();setTimeout('autoRequest();',10);",3000);
}
</script>
C:/Documents and Settings/Administrator.JK/Desktop/a1.html
接受请求的页面,可以是其它域的页面
---------<script>
alert("request at "+new Date());
</script>
只是用C:/Documents and Settings/Administrator.JK/Desktop/a1.html来演示一下效果
//在控制页建一个框架,然后把提交页在这个框的非模式窗口打开,它会弹出确定,
//说明你提交成功,
//刷新框,非模式窗口自动关闭,IE自己来,
//它会强制关闭确定
//重复上面<iframe style="display:" name=if0 ></iframe>
<input type=button value="autoRequest" onclick="autoRequest();"><br>
<script language=javascript >
function autoRequest()
{
if0.showModelessDialog("javascript:alert();","","status:no;resizable:no;help:no;dialogHeight:height:30px;dialogHeight:40px;");
setTimeout("if0.location.reload();setTimeout('autoRequest();',10);",3000);
}
</script>//有一事想不能,为什么当那个确定得到焦点时复制到的内容会是下面的?
---------------------------
Microsoft Internet Explorer
------------------------------------------------------
确定
---------------------------
但是我一测试,还发现一个问题.
继续上面的假设,我按照 JK_10000 提供的方法改进程序后。abc.jsp 里如果有动态操作代码的话,只会执行一次,在后面的 showModelessDialog() 只是调用缓存的了。当然把a.htm 关掉后,重新打开过,又会真正的执行一次。(除非我在IE里设置好“每次访问该页时检查”的话才如愿!)那在某种意义上,我本来是“每隔一秒钟做一次表单提交操作”,使用JK_10000(JK) 方法后,表面上是 “每隔一秒钟做一次表单提交”,但是执行结果,实际上是只提交操作一次。
HTTP 的 Socket
---也不知是怎么回事回复人: onetop(玩极) ( ) 信誉:99 2005-08-30 14:27:00 得分: 0
---缓存问题,在url后带个随机数就可以解决回复人: mrshelly(Shelly) ( ) 信誉:100 2005-08-30 14:29:00 得分: 0
也应该可以达到效果,应该更符合楼主要求
a.htm
-------------
<iframe style="display:none" name=if0 ></iframe>
<input type=button value="autoRequest" onclick="autoRequest();"><br>
<script language=javascript >
function autoRequest()
{
if0.showModelessDialog("C:/b.htm","","status:no;resizable:no;help:no;dialogHeight:height:30px;dialogHeight:40px;");
setTimeout("if0.location.reload();",3000);
}
</script>---------------
c:\b.htm
---------------<script>
alert("request at "+new Date());
</script>可以看出JK兄的脚本水平已经达到了极致。
<script language=javascript>
function window.alert(str){
//这里为空
}
alert("fffffff");
</script>
把重载后的alert函数定义function window.alert(str){}放到一个公共的js文件中 就再不受alert的麻烦了如果还要提示的话,采用这样的办法定义
function window.alert(str){
// 在这里打开一个模式对话框 显示str字符串 延时 20ms关闭 即可
}
不过用xmlhttp提交然后解析结果到是一个不错的办法。
至少可以实现你想要的结果。
那样alert()根本就不会被运行。//////////////////////////////
>我倒想起来一个办法,重载alert函数
><script language=javascript>
>function window.alert(str){
>//这里为空
>}
是不是学OO玩过火了,测试过了么?不要毒害别人啊。