父窗口调用子窗口 浏览器
var hasMore = parent.document.getElementByIdx_x_x_x("hasMore").value;
document.frames["ifrmBoxFrame"].me.preLoadBoxGrid();
window.frames["iframe_ID"].document.getElementByIdx_x_x_x("iframe_document_object"-).object_attribute = attribute_value;
如: jsp
window.returnValue = ret; window.close();
如: url
top.frames[tabID].location = url; top.document.frames("ifrmBoxFrame").me.executeQueryCond();
如: spa
parent.$("Insheet_FrameTable").src = ""; parent.frames["Insheet_FrameSheetList"].initInsheetList(false);
opener code
opener用于在window.open的页面引用执行该window.open方法的的页面的对象。例如:A页面经过window.open()方法弹出了B页面,在B页面中就能够经过opener来引用A页面,这样就能够经过这个对象来对A页面进行操做。 htm
如: 对象
var url="editarable.htm?arableID=" + curArableID+"&isDeleteDisabled="+$("Btn_delArable").disabled;
window.open(url, "viewArable", "height=" + h + ",width=" + w + ",left=" + x + ",top=" +y + ",status=no,toolbar=no,menubar=no,location=no");
//第二个页面中 使用opener if(!(window.opener==null || window.opener.closed)){ window.opener.me.queryArable(); } window.close();
首先来讲说 parent.window与top.window的用法
"window.location.href"、"location.href"是本页面跳转
"parent.location.href"是上一层页面跳转
"top.location.href"是最外层的页面跳转
举例说明:
若是A,B,C,D都是jsp,D是C的iframe,C是B的iframe,B是A的iframe,若是D中js这样写
"window.location.href"、"location.href":D页面跳转
"parent.location.href":C页面跳转
"top.location.href":A页面跳转 get
parent.frames("frmEletroDocAttachInsert").frames("fraEletroDocAttachView").document.location = "about:blank"; top.document.frames('ifrmMainFrame').location.reload();