Welcome to WebmasterWorld Guest from 174.129.96.175

Forum Moderators: incrediBILL

need a script to pop orphan pages into their framesets

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

WebmasterWorld Senior Member 10+ Year Member



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

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



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)

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



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)

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



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.

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month