Code in Parent Page
- <script type="text/javascript">
- function openChildWindow() {
- window.open('UrlToOpen', 'mywindow1234567890');
- window.CallParentfunction= function () {
-
- }
- }
- </script>
-
- <a onclick="openChildWindow(); return false;">Open Child Window</a>
Code in Child Page
Calling Function of Parent Window in Child Window:
- <script type="text/javascript">
- window.onunload = function (e) {
- opener.CallParentfunction();
- };
- </script>
Note:This doesn't
work on IE if the the Child window and the Parent window are not from the
same domain.