Welcome to WebmasterWorld Guest from 54.211.82.105

Forum Moderators: incrediBILL

Message Too Old, No Replies

need a script to pop orphan pages into their framesets

     
6:33 pm on Nov 17, 2000 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 10, 2000
posts:2151
votes: 0


of course it needs to work in both IE and NS ;)
7:51 pm on Nov 17, 2000 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


oilman, I use this basic JavaScript:

if (parent == self) location.replace("frameset.html");

This script only allows one configuration of pages in the frameset. So, I define a different frameset for each potential orphan. This allows me to create a unique NOFRAMES section for each orphaned content page. There is no conflict between NN and IE here.

If you have lots of potentially orphaned pages and you want to be able to pop each one into the very same frameset using only one script --- well, I'm wrestling with a situation like this right now, and I don't have the answer.

The challenge comes because you can't define a js variable in one window -- the orphaned page, and pass that variable to another window -- the frameset.

10:49 pm on Dec 7, 2000 (gmt 0)

Senior Member

WebmasterWorld Senior Member mivox is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Dec 6, 2000
posts:3928
votes: 0


you can also add this similar bit of code into your orphan's <body> tag:

<BODY onLoad="if (top == self) top.location.href = 'http://frameurl.html';"

1:29 am on Dec 8, 2000 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


mivox,

Welcome to the forums. Yes, that's another way to accomplish the job.

Advantage: It's backward compatible code, all the way back to JavaScript 1.0

Disadvantage: It makes a second entry to the browser history. The Back button will cause the browser to loop, returning to the same frameset page it started on, instead of what the user expects intuitively.