`

iframe嵌套iframe往父窗体传值

 
阅读更多

第一个iframe

<div>
 	<iframe style="width:810px;height:330px;border: 0px solid;" src="${ctx}/daliycheck/turnout_organManage.action"></iframe>
 </div>
	function closeNewWin(userName,showUname,taskpeoTime){
			$("#taskPeo").attr("value",userName);//
			//
			$("#taskPeoShow").attr("value",showUname);
			$("#taskpeoTime").attr("value",taskpeoTime);
			//关闭弹出层
			closeNewDiv("divSCA8",1);
		} 

 第二个iframe

 function closeFrame(userName,showUname,taskpeoTime){
   		parent.closeNewWin(userName,showUname,taskpeoTime);
   }
<table style="width:780px;height:300px;">
  	<tr>
  		<td width="230px">
  			<iframe style="width:100%;height:300px;border: 1px solid #3399FF;" src="turnout_districtZTree.action" id='districtFrm'  name='districtFrm'></iframe>
  		</td>
  	 	<td width="230px">
  	 		<iframe style="width:100%;height:300px;border: 1px solid #3399FF;" src="turnout_deptZTree.action" id="deptFrm" name="deptFrm"></iframe>
  	 	</td>
  	 	<td width="330px">
    		<iframe style="width:100%;height:300px;border: 1px solid #3399FF;" src="turnout_userInput" id="intutFrm" name="intutFrm_1"></iframe>
  	 	</td>
  	</tr>
  </table>

 userInput中对应的方法:

 function closeFrame(userName,showUname,taskpeoTime){
           parent.closeNewWin(userName,showUname,taskpeoTime);
   }

 userInput中调用第二个iframe的方法并传值,第二个iframe的方法,调用第一个iframe的方法并传值。这样就可以实现从 第二个嵌套的iframe中传值到它父类的父类所在的方法了。

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics