在子框架, 父框架 页面上的js 操作

 

在子框架页面上的操作 

<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>


 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值