jQuery parent page calls child page method

 var id = document.getElementById('id');//子页面打开id
 if(id!=null){
   var frameId =id.getElementsByTagName("iframe")[0].contentWindow.test(id,name);
 }

test is the method of the subpage
or

var iframe = window.parent.document.getElementsByTagName('iframe')[2];
var content = iframe.contentWindow.document.getElementById("iframeId");
content.contentWindow.initTaskList(currentTask,currentPage);

The child page calls the parent page method
window.parent.openUnCompany();

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326265135&siteId=291194637