This one uses hardcoded function references to communicate between windows: this (parent) window has an initCalc function declared which is evaluated on child window' DOMContentLoaded event. Child window has an evaluateCalc function declared which is evaluated when you click "Evaluate" button. Parent window refer to child window with an arbitrarily chosen identifier, in the example it is child_window; child window refer to parent window with an opener identifier.

Control elements in this block will be available when a child window calculator gets initiated.