Mah I use it on my website. If a user with js enabled accesses a page
without passing from the front page 8that is, outside a global frameset, for
the index page of the site _is_ a frameset file), I set up a few tricks to
let him/her see the desired page but firstly dashing through the main page,
so reinstating it within the frameset: but maybe for an iframe you don't
truly need a frameset, it might suffice that in your file you check whether
self.location==top.location.
If that is the case, you redirect to the other page which includes the
iframe document.
That is, put this command in your iframe meant file:
if(self.location==top.location)location.href="othe rfile.html";
Assuming otherfile.html is the file which includes the iframe.
it could be either simple like that, or you may append a ?plusData to the
url if you need to pass parameters emulating sort of a 'get' method in a
form..
ciao
Alberto vallini
http://www.unitedscripters.com/
"la_haine" <p.haine@kent.ac.uk> ha scritto nel messaggio
news:bnm15p$d9j$11@athena.ukc.ac.uk...[color=blue]
> 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[/color]
browsers,[color=blue]
> 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[/color]
that[color=blue]
> has television confused with entertainment, doritoes confused with food, a[/color]
nd[color=blue]
> Dan Quayle confused with a national political leader, masochists are[/color]
clearly[color=blue]
> less mixed-up than the rest of us.'
> -P.J.O'Rourke, 'Modern Manners'[/color]