473,395 Members | 2,446 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,395 software developers and data experts.

How to target to an iFrame?

118 100+
Hi all,

I am doing an e-portfolio and as part of which I am saving the documents in pdf format. I have used a frameset with a topFrame and mainFrame.

There are links to documents in topFrame.html and an iFrame in mainFrame.html. What I was planning on doing was, when the user clicks the links in topFrame the link is opened in the iFrame (named and ID'd "frame" (rather than targetting to 'mainFrame' itself)).

The only problem is that the iFrame is on a different page to the links, even as part of the frameset. Would it be possible in HTML to target the links to 'frame'? Or should I be looking for a javascript solution?

Sam
Nov 2 '07 #1
1 2675
gits
5,390 Expert Mod 4TB
hi ...

i think you have to use javascript for that, have a look at the following simple example, that shows you how to refer to specific frames with javascript:

[HTML]<html>
<script type="text/javascript">
function load_in_iframe(url, frame_ref) {
frame_ref.location.href = url;
}
</script>
<body>
<iframe name="test1" src="http://www.google.com"></iframe>
<iframe name="test2" src="http://www.thescripts.com"></iframe>
<a href="#" onclick="load_in_iframe(frames.test2.location.href ,
frames.test1);">
load url of frame 2 to frame 1
</a>
</body>
</html>
[/HTML]
kind regards
Nov 5 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Federico Bari | last post by:
Hi all, does somebody know how to target the answer of a form to an iframe (in ie expecially)???? I use iframe as temporary object to redirect the content do a layer built with a <div...> tag;...
4
by: DaveO | last post by:
Hi all I have done lots of VB programming, but am not familiar with JavaScript. Can anyone tell me how to do this ....? I have a JS file for a menu system called menu.js It contains the...
0
by: gb | last post by:
I have ParentB.html that contains ChildB.html in an IFRAME <IFRAME NAME="textareaB" SRC="ChildB.html"></IFRAME> ChildB.html contains a bookmark <A HREF="#GoHereB"></A> Also I have ParentA.html...
36
by: randau | last post by:
I would like to use the Link Target attribute, but am inhibited by the likelihood of a newly opened browser window completely hiding the Parent browser window. Thus offering the illusion that...
0
by: Steve Richter | last post by:
Am I able to change the target=_self, _parent, ... attribute of a document so that the document can break out of the iframe that contains it? for example, I would have a button outside of the...
7
by: ukrbend | last post by:
I use an iframe on my home page and everything works perfectly. But now I decided to add a popups to my page. The popups come not from within the iframe but from the parent frame. Again, everything...
15
by: Phlip | last post by:
Javascripters: I have an outer page and an inner iframe. The outer page calculates some javascript, and wants the inner frame to run it. The inner frame should hit a page on the same (private)...
4
by: linuskamb | last post by:
I have a problem which is a slight twist on discussions I have seen previously here and elsewhere. I have a form with an input select combo box whose target is an internal static iframe. The form...
4
by: sunil | last post by:
How do I find the length of page in target iframe? I am looking for the code or give me idea to find the length
0
by: oopaevah | last post by:
Hi, I have a set of valid xhtml pages that a third party web site is integrating with via an <iframein his own page. This retains his own branding template in the header and footer, with the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.