473,730 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to target to an iFrame?

118 New Member
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 2709
gits
5,390 Recognized Expert Moderator Expert
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.locat ion.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_i n_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
13835
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; this is possible with an hiperlink: clicking on it i can change the layer content whit a file in a URL location storing the answer first in the iframe and then sending is content to the <div...>. Here following the code: <script>
4
13862
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 following function :
0
4068
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 that contains ChildA.html in an IFRAME <IFRAME NAME="textareaA" SRC="ChildA.html"></IFRAME> Directories .../B/ParentB.html .../B/ChildB.html
36
3972
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 you're still in the same browser, but the Back Button no longer works. I've done some experimentation and came up with the conclusion that Microsoft's IE browser has a relatively small likelihood of that happening, but that Netscape's browsers...
0
932
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 iframe that contains the document. click the button and the document is expanded to display within the _parent of the iframe. form has a target= attribute: <form id="form1" target="_self" >
7
4735
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 regarding the popup works perfectly, it pops up with the correct data. But the strange thing is now any link that targets the iframe simply get ignored and instead of displaying things in the iframe they get displayed in a new browser window...
15
2272
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) web server, so this is not a cross-site scripting attack. But I would prefer not to taint the target page with any extra logic to do this. (I will if I must.) The calling page has these elements:
4
12050
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 can possibly be submitted several times as users change the selection in the combo box. On first selection (and form submit) the resulting content is properly directed into the iframe. However, on subsequent form submits, a new window is...
4
1713
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
5451
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 iframe containing my pages in the middle of the screen. When it is time to exit my pages, to take the user back to the third party web site, I need to direct the browser out of the iframe and to one of his pages. I leave it at that and his site...
0
8770
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9440
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9299
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...
0
8179
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
6722
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
4800
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3251
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
2
2710
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2174
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.