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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force page to appear in frameset 1

Status
Not open for further replies.

iowtech

Programmer
Aug 10, 2001
110
GB
I need a neat and quick way to force a page to appear within my frameset, without forcing people to the default page.

Eg. If someone types in
I want them to see the child page but within the frameset.

Alot of solutions would redirect to the index page of the site and the user would have then have to locate the page again.

Any help appreciated.
 
<script>
var domain = 'if (top.location.href!=domain){
var page=document.location.href.split(domain)[1];
top.location.href='}
</script>

The above can be used to force the use of a <FRAMESET> with ?document.html in the URL.

Use document.write() in the index.html to create a frameset and paste the ?document.html from the URL into a frame.

<script>
var page=document.location.href.split('?')[1];
document.write('<frame src=&quot;'+page+'&quot;>');
</script>

Obviously there are a few blanks that need to be filled in but I hope this helps :)

----------
I'm willing to trade custom scripts for... [see profile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top