Below is the code that I have been working with. I’ve set up a frame and I want to catch when a user closes or navigates away from the frame main page. The functions below do just that but despite the “parent” the exitCheck() and assuming the test() function are called for the the pages accessed through the frame, so although it does work the message is repeated several times and it is annoying. I only want to display the message if the main/parent page is closed. Any thoughts to what I am doing wrong?
I assume this is because all the windows in the frame are closing, but I just can’t seem to stop the message from being displayed not matter what I do.
~Phoenix
[CODE]<HTML>
<HEAD>
<META HTTP-EQUIV=”PRAGMA” CONTENT=”NO-CACHE”>
<TITLE>Main</TITLE>
<script type=”text/javascript”>
parent.onbeforeunload = exitCheck;
parent.onunload = test;
function test(){
parent.location = “systemlogout.php”;
}
function exitCheck(evt){
return “You are currently accessing a secure system and the navigation has been locked to prevent data loss.”
}
</script>
</HEAD>
<FRAMESET border=0 rows=”100%,*” frameborder=”no” marginleft=0 margintop=0 marginright=0 marginbottom=0>
<frame src=”123.php” NAME=”main” scrolling=auto frameborder=”no” border=0 noresize>
</FRAMESET> <NOFRAMES>You must use a browser that can display frames
to see this page. </NOFRAMES>
</HTML>