473,230 Members | 4,210 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,230 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 2061
> 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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.