Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forcing page into frameset

Status
Not open for further replies.

credo

Programmer
Jul 26, 2001
50
GB
Hello all,
I have a frameset called index1.asp which consists of 2 frames a top frame and a mainframe.

.... within index1.asp, after </head> ....

<frameset rows=&quot;21,*&quot; border=&quot;0&quot; framespacing=&quot;0&quot;>
<frame src=&quot;top.html&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; name=&quot;topFrame&quot; frameborder=&quot;0&quot; scrolling=&quot;NO&quot; noresize>
<frame src=&quot;welcome.html&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; name=&quot;mainFrame&quot; frameborder=&quot;0&quot; noresize>
<noframes>
<body bgcol

etc.. </frameset>

There is another page within my site that gets linked to from outside my site. I want this (and a couple of other pages) to get loaded within the frameset when navigated to.

I'm using the following within the pages I want loaded within the frameset : eg. fred.html

<script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;>
<!-- Hide script from old browsers
if (top.location == self.location) {
self.location.replace
(&quot;index1.asp&quot;)
}
-->
</script>

This does not replace welcome.html with fred.html. What am I doing wrong ?

thanks,
Credo

 
im guessing that what youve got is replacing your page fred.html with index.asp?

in that case you just need to add a line to change the location of the mainframe something like:

top.frames.mainframe.location=&quot;fred.html&quot;;

hope this helps..

:)
 
thanks crazyboybert
- yes when I link to that page it ends up showing top.html and welcome.html I want it to show top.html and fred.html.

... sorry but where do I add that line exactly (within the if?)

thx
 
i'm afraid you should pass this new page's name like a parameter to your index.asp:

<script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;>
<!-- Hide script from old browsers
if (top.location == self.location) {
var loc=&quot;index1.asp?fred.html&quot;
self.location.replace(loc)
}
-->
</script>

& in your frameset you should extract this parameter from search string & set like a source to the needed frame..

somethink like that.. Victor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top