通过
$.dialog({
id: "ai",
title: title,
lock: true,
width: width+'px',
height: height,
content: 'url:'+url
});方法打开窗口后,想在打开的子窗口里调用父窗口的方法,用parent是取不到的,只能用frameElement.api.opener才能取到。
$.dialog({
id: "ai",
title: title,
lock: true,
width: width+'px',
height: height,
content: 'url:'+url,
ok: function() {
this.iframe.contentWindow.doSave();
return false;
},
cancel: function() {
this.iframe.contentWindow.doClose();
return false;
},
cancelVal: '关闭'
});
this.iframe.contentWindow用来在父窗口里调用子窗口的方法,return false是阻止默认的关闭事件。