父窗口:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>房山百词测试-EnglishOK</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<link href="<%=request.getContextPath()%>/css/baici/test.css"
rel="stylesheet" type="text/css" />
<script language="javascript">
function setTitle(title){
if(title)
document.getElementById("title").innerHTML=title;
}
function setHeight(height){
if(height && height>400){
document.getElementById("myFrame").style.height = height;
}else{
document.getElementById("myFrame").style.height = 400;
}
}
</script>
</head>
<body >
<div class="logo"></div>
<div class="tag">
当前位置:
<span id="title"></span>
</strong>
</div>
<div id="content">
<!--插入内容-->
<iframe scrolling="no"
src="<%=request.getContextPath()%>/examineeInfo/totestFrame1.action"
style="background-color: transparent;" frameborder="0" width="960px"
allowTransparency="true" id="myFrame"></iframe>
</div>
<div id="foot"></div>
</body>
</html>
------------------------------------------
子窗口调用:
<script language="javascript">
//<!--
function init(){
parent.setHeight(500);
parent.setTitle("测试须知");
}
//-->
</script>
</head>
<body οnlοad="init()">