04-27-2004, 05:39 PM
04-27-2004, 05:55 PM
why do you have to use frames? they're a big no-no. they have been since they first came out.
you can achieve the same effect these days using layers and iframes or object tags.
04-27-2004, 06:35 PM
i was used just using empty frames to center my site. like www.cecildreeme.com
so it will be centered no matter what the persons screen resolution is. could i do that with layers an iframes?
04-27-2004, 06:58 PM
Yes it is possible. In your frameset, where you define your frames, you must ensure to give those frames unique names.
That way you can refer to those frames by their names, for example:
<frame src="file1.html" name="frame1">
<frame src="file2.html" name="frame2">
So basically file1.html might have a function in it called functionName(). The window.top... line could be called in file2.html, so it's calling functionName() in file1.html.
Now the important thing to note is that all files in all frames must exist on the same server/domain. You can't load up Google in one of your frames and try to call its functions as you will get an Access Denied error. If you get that right now trying to make your site work, then ensure that each file is on the same domain and if your links are not relative but absolute, that your links have the same domain reference (ie. be consistent: only use IP addresses or domain names, don't mix and match because that will give you some grief!)
Hope that helps,
04-27-2004, 07:08 PM
I was trying to figure out why anyone would bash frames.. so I Google'd it and came up with the following link:
So now I sort of understand why frames can be bad... but I still like them!
04-27-2004, 08:16 PM
sad69 i tried using the window.top.frames thing but it's not working. this is the code im using in my opening page:
location = ("index2.htm");
when a link is clicked that function is executed. And it goes to index2 but it doesn't run the go function located in the _body frame. i also have the frame named _body so i can't be that.
this is the go function:
parent._left.location= (name + "left.htm");
_right.location= (name + ".htm");
the go function works when i click a link that is located in the _body frame.
04-27-2004, 08:19 PM
I dunno why, but try changing top to parent and see how that works out..
04-28-2004, 07:36 AM
location = ("index2.htm");
It does not work because index2.htm, which contains the nested frames one of which you were referencing, has not finished loading.
Instead of using bunches of frames, why not use iframe (http://www.w3.org/TR/html401/present/frames.html#edef-IFRAME) and then put the links in the same page where the iframe is?