Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: forcing a pgae back into frameset


Message #1 by Jon Edwards <jpedwards@b...> on Thu, 19 Jul 2001 16:58:10 +0100
Absolutley perfect, thanks very much for that.
Jon E


At 21:56 19/07/01 +0100, you wrote:
>Here is a snippet of code I wrote a few years ago, should be good basis 
>for your needs, I now tend to use a .js file and tables to provide the 
>navigation, check out http://www.methodiststudent.org.uk for an example.
>
>In the pages add :
>
><script language="Javascript">
>var frame_builder = 'index.html'
>if (top.document == self.document)
>{
>  if (confirm('This page is normally in a frameset. Do you wish to load
>it in context?'))
>  {
>window.location = frame_builder +'?'+ window.location.pathname
>  }
>}
></script>
>
>The frame builder becomes :
>
><script language="Javascript">
>var thatframe = 'somepage.html'
>if (location.search) {
>var thatframe = (location.search.substring(1,location.search.length))
>}
>var frameset = '<FRAMESET ROWS="50%,50%">'
>+'<FRAMESET COLS="100%">'
>+'<FRAME NAME="thisframe" SRC="somepage.html" MARGINHEIGHT=0
>MARGINWIDTH=0 SCROLLING=AUTO NORESIZE>'
>+'<FRAMESET COLS="100%">'
>+'<FRAME NAME="thatframe" SRC= "'+ thatframe +'" MARGINHEIGHT=0
>MARGINWIDTH=0 SCROLLING=AUTO NORESIZE>'
>+'</FRAMESET>'
>document.write(frameset)
></script>
>
>


  Return to Index