A:list主页面,里面嵌套iframe,B页面,B页面嵌套iframe  C页面

 

现在在B页面,通过layer.open打开C窗口(layer其实是嵌套iframe)

var myConfig = {
		type: 2,
		shadeClose: false,//点击阴影关闭
		shade: [0.5,'#393D49'],//透明度
		maxmin: true, //开启最大化最小化按钮
		title: '弹出窗口',
		area: ["800px","400px"],//弹出层大小
		btn: ['确定','关闭'],
		yes:function(index, layero){
			window.parent.window.layer.close(index);//关闭
			var iframeWin = window.parent.window[layero.find('iframe')[0]['name']];  //通过window name找到子iframe窗体
			var result=iframeWin.submit();    //B页面调用C页面的submit方法,即是父窗口调用子窗口方法
			//
		},
		cancel: function(index, layero){ 
			window.parent.window.layer.close(index);//关闭
    	},
		content:'${path }/....',
	}
	window.parent.layer.open(myConfig);

  

子页面C想获取父窗体B页面变量或调用方法:

parent.$("#父窗体iframe")[0].contentWindow.functionB();

 

相关文章:

  • 2021-07-22
  • 2021-10-20
  • 2021-12-04
  • 2021-08-27
  • 2022-12-23
  • 2021-09-26
  • 2021-08-24
  • 2021-09-03
猜你喜欢
  • 2022-12-23
  • 2021-09-30
  • 2021-12-31
  • 2021-07-03
  • 2021-09-26
  • 2022-12-23
  • 2021-09-14
相关资源
相似解决方案