The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> HELP! redirecting individual pages to main frames page
Matthew_James_88
post May 5 2016, 04:13 PM
Post #1





Group: Members
Posts: 1
Joined: 5-May 16
Member No.: 24,224



Hi guys. I am new here. Hope I have posted this in the right place. I know this is a very outdated method now, but wondered if anyone could shed any light on what I am doing wrong.
I have tried using these java scripts, so that if a user comes across one of my individual pages, they will be redirected to that very page, but with the frameset (my navigation and banner frames). Problem is that when I have tried it out, it will just keep refreshing the page non stop!

my site is www.matthewjamesrichards.co.uk

(at present I have removed the java scripts from the page - but this is what I have done below)

here is the code I pasted on my index page:


<script language="javascript">
var fname="top"; //MAIN CONTENT AREA FRAME **NAME**

window.onload=function(){
var d=document.location.search;
if(d!='')top.frames[fname].document.location.href=d.substring(d.lastIndexOf('?')+1,d.length);
}
</script>

<frameset cols="194,90%" framespacing="0" border="0" frameborder="0">
<frame name="left" scrolling="no" noresize target="rtop" src="banner.htm">
<frameset rows="81%,19%">
<frame name="top" target="top" scrolling="auto" src="home.htm">
<frame name="bottom" scrolling="no" noresize src="menu.htm" target="_self">
</frameset>




here is the code I place on each indivual content pages (such as home, about me, areas covered etc)

areas page

<script language="javascript">
if(self.location==top.location)self.location="index.html?areas.htm";
</script>



now the interesting thing is, if I change var fname= ***** on the index page to either left, or bottom. I can get the page I want to appear in those frames, but when I set var fname="top"; (the frame I would like it to appear) it goes into a loop of craziness and keeps refreshing over and over.

I must be doing something wrong.

If there is anyone out there who could give me a hand, would be much appreciated.


User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Terminator
post May 14 2016, 03:53 PM
Post #2


Advanced Member
****

Group: Members
Posts: 218
Joined: 19-March 15
Member No.: 22,398



I suggest not using Frames at all. They have been outdated for years, and I am not sure if they are even supported on modern browsers anymore. I know they aren't part of HTML5.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post May 24 2016, 07:55 PM
Post #3


.
********

Group: WDG Moderators
Posts: 9,659
Joined: 10-August 06
Member No.: 7



QUOTE(Terminator @ May 14 2016, 10:53 PM) *

I suggest not using Frames at all. They have been outdated for years

True.

QUOTE
and I am not sure if they are even supported on modern browsers anymore.

They are, and will most likely continue to be supported due to all the legacy sites around.

QUOTE
I know they aren't part of HTML5.

There is no frameset element in HTML5, but if you use an HTML4 frameset page you can still frame HTML5 pages with it.

Iframes are still part of HTML5 though, despite being almost as problematic as framesets. No doubt this is because they are used for displaying ads, and several W3C members are advertizing companies.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 26th April 2024 - 06:01 PM