在子框架页面上的操作
<script type="text/javascript">
/**
*在子框架页面上的操作
*/
$(function(){
//获取当前页面实现需要的高度
var _height=document.body.scrollHeight;
//获得父页面的document
window.parent.document;
//获得父页面的标题
window.parent.document.title;
//调整父页面的高度
window.parent.document.getElementById(name).height = _height;
//获得父框架的高度
function getHeight(){
var _height=window.parent.document.getElementById("parentframe").height;
var tmp=_height-5;
//设置本页面的高度
document.getElementById("editFrame").height=tmp;
}
});
</script>
在父框架页面上对子页面的操作
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<html>
<head>
<title>网页对话框</title>
<%@ include file="meta.jsp"%>
<meta http-equiv="Cache-Control" content="no-store"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="0"/>
<script type="text/javascript" >
$(function() {
setTimeout(settitle,300);
});
//获得子页面的标题后,将父页面的标题设置为子页面的标题
function settitle() {
var child_document=frames["wrapper"].document;
document.title=child_document.title;
}
</script>
</head>
<body >
<table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<iframe name="wrapper" id="wrapper" width="100%" height="100%" frameborder="0" src="<%=request.getParameter("url")%>"></iframe>
</td>
</tr>
</table>
</body>