(1) The method or variable that the child page calls the parent page:
Window.parent. Method () or variable name
Window.parent is equivalent to locating the parent page and writing code in the parent page.
Window.parent.aa (); // The window.parent.bb of AA function is adjusted ; // Pick BB Variable For example, to get the value window.parent.$ ("#aaa") of the text box with ID AAA in the Sub-page. Val (); // window.parent.getElementById (//JS notation
(2) parent page Fetch sub-page
Mainly through Contentwindow to the sub-page
document.getElementById ("Childframe"). Contentwindow.childtest (); // Childtest method in the paging sub-page js notation var childwindow = $ ("#addFrame") [0].contentwindow; // gets the object in the subform childwindow.formsubmit (); // Formsubmit method for fetching sub-pages how jquery is written // commented: Where Childframe and Addframe are the IDs of the IFRAME
JS Child page Parent page method variables call each other