473,748 Members | 6,418 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.h istory.go(h-parent.fRight.h istory.length);
parent.fLeft.hi story.go(g-parent.fLeft.hi story.length);
}

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

<a href="javascrip t:home(1,1)">Op ening 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 2090
> 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.htm l"
id="myframe1"
name="nameframe 1"
scrolling=yes>
<frame src="frame2.htm l"
id="myframe2"
name="nameframe 2"
scrolling=yes>
<frame src="control.ht ml"
id="mycontrol"
name="namecontr ol"
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>Contro l</title>
<SCRIPT type="text/javascript">

function setFrame(frameI d)
{
var node = top.document.ge tElementById(fr ameId);

var mySRC = node.getAttribu te("SRC");

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

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

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

</script>
</head>
<body>
<a href="http://www.google.com"
onclick="change Frame1();return false">link
to Google News in Frame 1</a>
&nbsp;&nbsp;&nb sp;
<a href="http://www.yahoo.com"
onclick="setFra me('myframe2'); return false;">Origina l
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
2241
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 loads inside the small footer frame. I'd like it to just get rid of the frames completely when I clickon the link. Any clue? Thank you.
3
2727
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 of two frames. I have a <a href="....."> link on the second frame of that window. What I want is that when user clicks on the link in the new window's second frame,
36
3887
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 explain this? Here is my code: (code optimization will be done later) 1. The HTML file <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head>
2
1334
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. Assume im not able to change the source code of frame1 and frame2. I can only change the source code of main page. Is there any way. Also the links may point anywhere, not necessarily "javascript:fn()". i.e., can i control the links in...
5
1868
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 LINK. I have a function that builds the answer frame using document.write(among other things). This code works fine until you encounter a link. It dutifully displays the link in the lower frame but the very next question builds the newContent...
6
2833
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 (frameset) page, though. It appears you can do somehing like document.onClick = blah to ensure that the function blah is called when someone clicks on a link in the
3
1387
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 with HREF but it doesn't work becouse with HREF i can use only one link... or not??? :) thanks for any help :-)
4
3042
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 adr As String </script>
7
3971
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 by some limitation issues of SharePoint. To help:
0
9366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9316
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8239
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4597
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2211
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.