Forum Moderators: open
I figure I can use something like
<body onunload="removeBottomFrame()">
to catch the event, but how do I close the other frame and still allow the link to be followed?
I've tried things like putting this in my frametop.html:
<script language="javascript">
function loseFrame() {
top.location.href=document.location.href;
}
</script>
<body onunload="loseFrame();"/>
But it changes top's location to the then-current location of the top document, and the link you just clicked on is lost forever. (Worse yet, you end up in this recursive loop--onunload keeps getting called for every link, keeping you on that page forever.)
Can it be done? Can I capture the new href somehow? Can I remove the frame without changing the "location" attribute, allowing the browser to continue on with what it was doing with it?
If it helps, I'm on a system that's guaranteed to be IE only.
Are you generating your own pages with dynamic links provided by some process? If so, you would have control of the <body>, at least.
This comes from trying to figure out why you have no control over the code in the top frame. Your only option may be to provide a "Remove Frames" link on the doc you control.
That said, I did figure out the solution I was looking for. And I guess I have to be thankful to Livelink for this one. The common header code allows you to pass in the name of a javascript function that does something with any url that's picked from the header. So all I have to do is create my javascript function that accepts a url, and set the top-level window's location to that url. Done. The solution was easy. Finding a solution like that in Livelink is extremely painful.
But it's done. If you still want to help, you can look at my other post about windows disappearing.
Thanks.