<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
head
>
<
meta
http-equiv
=
"Content-Type"
content
=
"text/html; charset=utf-8"
/>
<
title
>Untitled Document</
title
>
<
style
type
=
"text/css"
>
.left{float:left; width:400px; height:400px}
.right{float:left; width:400px; height:400px}
</
style
>
</
head
>
<
body
>
<
div
class
=
"left"
>
<
iframe
src
=
"maillogin.jsp"
width
=
"100%"
height
=
"100%"
frameborder
=
"0"
scrolling
=
"no"
;></
iframe
>
</
div
>
<!----在上一个iframe中写js代码让两个iframe同时跳转---->
<
div
class
=
"right"
>
<
iframe
src
=
"mailcheck.jsp"
width
=
"100%"
height
=
"100%"
frameborder
=
"0"
scrolling
=
"no"
;></
iframe
>
</
div
>
</
body
>
</html>
window.parent.frames[0].location.reload();
window.parent.frames[1].location.reload();
window.parent.frames[1].location.reload();
window.location.reload();
本文介绍了一种通过JavaScript操作父窗口中的子IFrame实现同步刷新的方法。此方法适用于需要两个IFrame页面交互且保持同步更新的场景。文章提供了具体的代码实例,展示了如何通过访问父窗口下的frames集合来触发子IFrame的页面重新加载。
209

被折叠的 条评论
为什么被折叠?



