theprofessorx
Programmer
i have a frameset with a top navigation frame (topFr) and a nested frameset with a left navigation frame (leftFr) and a content frame (contentFr). i am trying to code a handler for the event "onunload" triggered by contentFr and i don't want to use the HTML attribute as the handler.
i've placed the following code within script tags in the head section of the frameset page to test that contentFr object is referenced correctly: window.contentFr.onunload = function() {alert('you are unloading this page');}. no alert box comes up.
however, if i use the same code for the top level window such as: window.onunload = function() {alert('you are unloading this page');} - the alert box appears.
can somebody let me know why this alert does not appear when referencing contentFr and how to fix it? thanks much in advance.
i've placed the following code within script tags in the head section of the frameset page to test that contentFr object is referenced correctly: window.contentFr.onunload = function() {alert('you are unloading this page');}. no alert box comes up.
however, if i use the same code for the top level window such as: window.onunload = function() {alert('you are unloading this page');} - the alert box appears.
can somebody let me know why this alert does not appear when referencing contentFr and how to fix it? thanks much in advance.