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中傳值到它父類的父類所在的方法了。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章