能否捕获到iframe中包含的页面刷新? to :xiaoshi(java入门中....)(半知不解) 试了这个事件,但不会出发啊!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 fason(【阿信】) 不行啊!我是如下做的:无论 onbeforeunload还是onunload都不会触发tt()…… function tt(){ alert('test');}…… <iframe frameborder=0 id=i_main src="frame.aspx" width="97%" scrolling=no onabeforeupdate=tt()></iframe> 在XX2.html中<body onbeforeunload="alert()">试试 关键就是我需要在页面1中捕获,而不能在xx2.html中捕获!! 如何处理? <script> function a(){ alert() } </script> <iframe frameborder=1 id=i_main src="about:<body onbeforeunload='parent.a()'>" width="111" onbeforeunload=alert()></iframe> to (【阿信】) src="about:<body onbeforeunload='parent.a()'>" 这样写以后,我的目标页地址写哪啊?麻烦再讲清楚一点,我对javascript不熟悉。 我的目标页地址是frame.aspx 原来是这样写的: <iframe frameborder=0 id=i_main src="frame.aspx" width="97%" scrolling=no ></iframe> 我只是试验给你看可以能过parent.a()调用父页面的函数在frame.aspx中<body onbeforeunload="parent.a()"> 我现在需求是这样的:子页面不固定,且编码人员也不固定,无法要求对方在在页面中(frame.aspx)加入<body onbeforeunload="parent.a()">,只能在当前包含iframe的页面中编码设置。 这就是我上面所说“关键就是我需要在页面1中捕获,而不能在xx2.html中捕获!!”的原因!! 能不在子页面中写任何代码而实现此功能吗? div.html<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><title> New Document </title><meta name="Generator" content="EditPlus"><meta name="Author" content=""><meta name="Keywords" content=""><meta name="Description" content=""></head><body onresize='alert("test")' ><input type=hidden value=0 name=aa ><div id=ff><iframe src='refresh.html' id=ifrm ></iframe></div><script language="JavaScript"><!--function checkit(){ if(aa.value==1){ alert("Ò³ÃæÒѾ­Ë¢ÐÂ"); aa.value=0; } } setInterval("checkit()",2000)//--></script></body></html>refresh.html<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><title> New Document </title><meta name="Generator" content="EditPlus"><meta name="Author" content=""><meta name="Keywords" content=""><meta name="Description" content=""></head><body>al;skdfjal;sfjkaslkfjaslfkaskfasdfasfasdf;asdfl<script language="JavaScript"><!-- function testit(){ window.location.reload(); parent.aa.value="1"; } setInterval("testit()",2000);//--></script></body></html> 关于js点击按钮向表单插入字符的问题~~~~~~~~~~~ html页面能够写jquery的ajax方法吗 判断用户名是否合法 请教,这个正则表达式如何写呢 谁帮小弟看看这段代码是啥意思,谢谢! 就是这样的问题再看看 请帮忙 function问题 试试这个页面,如果去掉滚动条? 阿信哥哥,你的主页上的鼠标特效是怎么做的? VBScript中如何把byte数组转化为字符串? 急,有谁知道在javascript中,window.open()括号中带的参数,还望告知
……
function tt(){
alert('test');
}
…… <iframe frameborder=0 id=i_main src="frame.aspx" width="97%" scrolling=no onabeforeupdate=tt()></iframe>
<body onbeforeunload="alert()">
试试
function a(){
alert()
}
</script> <iframe frameborder=1 id=i_main src="about:<body onbeforeunload='parent.a()'>" width="111" onbeforeunload=alert()></iframe>
在frame.aspx中
<body onbeforeunload="parent.a()">
这就是我上面所说“关键就是我需要在页面1中捕获,而不能在xx2.html中捕获!!”的原因!!
能不在子页面中写任何代码而实现此功能吗?
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head><body onresize='alert("test")' >
<input type=hidden value=0 name=aa >
<div id=ff><iframe src='refresh.html' id=ifrm ></iframe></div>
<script language="JavaScript">
<!--
function checkit(){
if(aa.value==1){
alert("Ò³ÃæÒѾ­Ë¢ÐÂ");
aa.value=0;
}
}
setInterval("checkit()",2000)
//-->
</script>
</body>
</html>
refresh.html
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head><body>
al;skdfjal;sfjkaslkfjaslfkaskfasdfasfasdf;asdfl
<script language="JavaScript">
<!--
function testit(){
window.location.reload();
parent.aa.value="1";
}
setInterval("testit()",2000);
//-->
</script>
</body>
</html>