Jump to content
xisto Community
tansqrx

How To Auto Navigate Using Frames?

Recommended Posts

I have known this for a long time but I have a problem on my site and I need suggestions on how to fix it. My site (ycoderscookbook.com) uses frames. There are five frames to be exact, four on each side and the center one holds the content. I may just be a baby here but I really like the design and I hope not to change it.

Here is the problem, I have a JavaScript that places a page in the proper frames if navigated to by itself. There appears to be a flaw in the design because it goes to the main page if this happens. Even if say code.html is loaded, it always ends up at main.html.

if(top == self){	top.location.href = 'index.html';	}
The bottom line is I donĂ¢t care for JavaScript, I think it is the poorest excuse for a programming language ever. Can someone have mercy on me and post an example which will load the current requested page in the correct frame?

Share this post


Link to post
Share on other sites

when making your frameset page (the index page that people goto to see all the frames on one page) you need to add ID's so that you can ID each frame

<frameset rows="*,80" frameborder="no" border="0" framespacing="0">  <frame src="file:///C|/Program Files/Macromedia/Dreamweaver 8/Untitled-1" name="mainFrame" id="mainFrame" title="mainFrame" />  <frame src="file:///C|/Program Files/Macromedia/Dreamweaver 8/UntitledFrame-2" name="bottomFrame" scrolling="No" noresize="noresize" id="bottomFrame" title="bottomFrame" />
i have named the mainFrame and bottomFrame in this example

so the too snippets of code you are adding are

id="mainFrame"
and
id="bottomFrame"

then when you go to make your hyperlinks, make sure you add a target (the same as your ID before)

<a href="http://google.com; target="bottomFrame">Link to Frame </a>

good luck
-jimmy
Edited by Jimmy89 (see edit history)

Share this post


Link to post
Share on other sites

when making your frameset page (the index page that people goto to see all the frames on one page) you need to add ID's so that you can ID each frame

<frameset rows="*,80" frameborder="no" border="0" framespacing="0">  <frame src="file:///C|/Program Files/Macromedia/Dreamweaver 8/Untitled-1" name="mainFrame" id="mainFrame" title="mainFrame" />  <frame src="file:///C|/Program Files/Macromedia/Dreamweaver 8/UntitledFrame-2" name="bottomFrame" scrolling="No" noresize="noresize" id="bottomFrame" title="bottomFrame" />
i have named the mainFrame and bottomFrame in this example

so the too snippets of code you are adding are

id="mainFrame"
and
id="bottomFrame"

then when you go to make your hyperlinks, make sure you add a target (the same as your ID before)

<a href="http://google.com; target="bottomFrame">Link to Frame </a>

good luck
-jimmy
It's correct what you said but it is not absolutely necesary the use of the id use it if you want, just use the name property and do the same with your hyperlinks as Jimmy post below.

Best regards,

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.