frame breaking detection [SOLVED]
Posted: Sat Jan 05, 2008 12:55 pm
I have this javascript:
And I'm calling it like this on my frames page
It works good for closing the window and pages that have javascript that breaks frames. The problem is, one of the two frames has content that links to the frame set page via a link. It's essentially a refresh, reloading the two frames. I don't want this link to trigger the above onbeforeunload().
I've tried making the link with this attribute:
But it doesn't seem to work.
Code: Select all
<!--
function breaksFrames(ok)
{
if (ok)
{
if (ok == 1)
{
if(confirm("The page is breaking frames. Press OK to close the window, or Cancel to report."))
{
return true;
} else {
window.open("page-to-report");
return false;
}
return true;
}
}
}
// -->Code: Select all
<FRAMESET rows="100,*" onbeforeunload="breaksFrames(1);">I've tried making the link with this attribute:
Code: Select all
onclick="window.frames[0].breaksFrames(0);"