473,320 Members | 2,083 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Home link with frames !?

Aki
Hi!

I've been trying to create a home link in a document that is shown in
a frameset of two frames. My aim is to show the first documents that
were shown in the frames when the frameset was loaded the first time.
The link works perfectly in NN4.5 and 7.1, but IE6 and Opera7 are
causing headaches.

I've tried to do the link with the following script:

function home(h,g)
{
parent.fRight.history.go(h-parent.fRight.history.length);
parent.fLeft.history.go(g-parent.fLeft.history.length);
}

fRight and fLeft are frame names. The function is then called in the
following link:

<a href="javascript:home(1,1)">Opening page </a>
How can I get even IE and Opera to understand me?

I would be grateful for help!

Aki
Jul 23 '05 #1
1 2064
> I've been trying to create a home link in a document that is shown in
a frameset of two frames. My aim is to show the first documents that
were shown in the frames when the frameset was loaded the first time.
The link works perfectly in NN4.5 and 7.1, but IE6 and Opera7 are
causing headaches.

I have implemented a home like function for a frame. You will want to
write these files out to disk in the same folder. Start the file
frames.html. Click on the Yahoo link in frame 2. Click on the link
Original Frame 2 link.

IE may be have a restriction that you can only use numbers -1, 0, and
1 in the go function. This would correspond to back, reload, and
forward.

I am not totally sure how or in what way you wish to go back to the
original page.

I have implement some javascript code that lets you load the page
referenced in the frame tag. What I do is grap the src value from
within the frame tag on the page with the frameset tag. See funtion
setFrame in the control.html file. You may run into security
restrictions with these files if the link isn't in a file that is
stored on in the same directory as the file with the frameset.

I have tried this in Netscape 7.1, IE 5.2, and Safari in MacOS 10.2.6.

Robert
frames.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Frames Layout</title>
</head>
<frameset rows="45%,45%,*" >
<frame src="frame1.html"
id="myframe1"
name="nameframe1"
scrolling=yes>
<frame src="frame2.html"
id="myframe2"
name="nameframe2"
scrolling=yes>
<frame src="control.html"
id="mycontrol"
name="namecontrol"
scrolling=yes>
</frameset>
</html>

frame1.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Frame 1</title>

</head>

<body>
<p>This is frame 1.</p>
<a href="http://www.google.com">Google</a>
</body>
</html>
frame2.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Frame 2</title>

</head>

<body>
<p>This is frame 2.</p>
<a href="http://www.yahoo.com">Yahoo</a>
</body>
</html>

control.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Control</title>
<SCRIPT type="text/javascript">

function setFrame(frameId)
{
var node = top.document.getElementById(frameId);

var mySRC = node.getAttribute("SRC");

alert("the location for replacement = " + mySRC);

top.frames["nameframe2"].window.location.replace(mySRC);
}

function changeFrame1()
{
top.frames["nameframe1"].window.location =
"http://www.google.com/news";
}

</script>
</head>
<body>
<a href="http://www.google.com"
onclick="changeFrame1();return false">link
to Google News in Frame 1</a>
&nbsp;&nbsp;&nbsp;
<a href="http://www.yahoo.com"
onclick="setFrame('myframe2');return false;">Original
Frame 2</a>
</body>
</html>
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dean J Garrett | last post by:
If you have a webpage with frames, say a footer frame that contains links, how can you get out of the frame if you click on a link in the footer. The it works now, is if I click on a link, the page...
3
by: Farooq Karim | last post by:
Greetings; I am unable to solve this problem; I hope someone will come up to show his brilliance. From my web page I open another link in another browser window. That new window is composed...
36
by: Peter Brause | last post by:
Hello, my stylesheet shows different colors for visited, active and hovered links. It works fine in IE 6, but in Opera 7 the color for the active link (red background) is never shown. How to...
2
by: sravi | last post by:
I have a webpage which contains two frames, let us call this as main page and the frames as frame1 and frame2. Now if i click any link in frame1 or frame2 a script in main page should be invoked....
5
by: imaband | last post by:
Hi, I've got a little Quizzer program that asks a question in the upper frame of a frameset and then lists the answer in the lower frame. Answers can be plain text, straight html, a sound, or a...
6
by: Tom Braun | last post by:
Hello! My first post here... I need to monitor if someone clicked on some (any) link in a subframe. Due to certain restrictions, the only place I can put some JavaScript is in the main...
3
by: Thorn | last post by:
hi! i have 2 frames in my website. what schould i do to have such a result that after click on image (for example) in two frames will shown 2 different sites. i was trying to do something...
4
by: Max | last post by:
Hello, here a user control named aff.ascx : (this control is used to see the contains of a link) <%@ Control Language="VB" %> <script runat="server"> ' Insert user control code here Public...
7
by: SHC | last post by:
I'm in need of some javascript to load two pages into two seperate iframes which are on two seperate and different pages. Rather complicated I know (and easier done in one frameset), but caused...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.