L
la_haine
I have a collection of pages that are designed to be called into an iframe
(named displayView), and the managers don't want people to be able to view
them unless they're in that iframe. If I use the following javascript:
<script language="javascript" type="text/javascript">
function bing() {
if (!top.document.displayView) {
document.writeln("sorry, you can't view this");
}
}
</script>
and use <body onload="bing">, it works in Opera and IE - displays the page
correctly if viewed through the iframe, but says 'sorry, you can't view
this' and nothing else if viewed outside of it. However, in mozilla browsers,
it doesn't work, and I get the error message regardless of how I view the
page.
Can anybody advise me on how to fix this?
--
'Masochists are people that have pleasure confused with pain. In a world that
has television confused with entertainment, doritoes confused with food, and
Dan Quayle confused with a national political leader, masochists are clearly
less mixed-up than the rest of us.'
-P.J.O'Rourke, 'Modern Manners'
(named displayView), and the managers don't want people to be able to view
them unless they're in that iframe. If I use the following javascript:
<script language="javascript" type="text/javascript">
function bing() {
if (!top.document.displayView) {
document.writeln("sorry, you can't view this");
}
}
</script>
and use <body onload="bing">, it works in Opera and IE - displays the page
correctly if viewed through the iframe, but says 'sorry, you can't view
this' and nothing else if viewed outside of it. However, in mozilla browsers,
it doesn't work, and I get the error message regardless of how I view the
page.
Can anybody advise me on how to fix this?
--
'Masochists are people that have pleasure confused with pain. In a world that
has television confused with entertainment, doritoes confused with food, and
Dan Quayle confused with a national political leader, masochists are clearly
less mixed-up than the rest of us.'
-P.J.O'Rourke, 'Modern Manners'