473,513 Members | 2,581 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

OnClick & IFrames

1 New Member
Hello there, I have a fairly simple problem but since my knowledge of JavaScript is limited, I'm not quite sure how to go about it.

Basically, I am developing a website for selling my products, and I have a menu bar with all the links to these specific products. Already I have the links going into an iframe, where you see the .html file containing the picture and the product's description. What I'd like to do is actually take that descriptive text and place it outside the iframe, in a layer preferably or perhaps even another iframe, but as such ... what I'm aiming for is when you click on the link, two things happen: the iframe gives you the picture, and another layer/iframe gives you the text. Pretty simple? Will I need to make two separate .html files for each product, one for the image and one for the description?

Thanks for your help.

-Bryan
Aug 29 '07 #1
1 1776
markrawlingson
346 Recognized Expert Contributor
Expand|Select|Wrap|Line Numbers
  1. function SetContent(obj,sText) {
  2. var oObj = document.getElementById(obj);
  3. oObj.innerHTML = sText;
  4. }
  5.  
call it like this..

Expand|Select|Wrap|Line Numbers
  1. <a href="javascript:SetContent('yourtargetlayersid','This is a wonderful description of a superb product which you should most certainly purchase!');">Your link</a>
  2.  
You'll, of course, have to have a div/span layer on the page.

Expand|Select|Wrap|Line Numbers
  1. <div id="yourtargetlayersid"></div>
  2.  
You can use the function numerous times over, and in what ever context you wish - onmouseover, onclick, onblur, whatever...
Aug 29 '07 #2

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

Similar topics

2
1417
by: Carl | last post by:
I want to load a javascript file on a root page with various iframes, then call the javascript functions from the root page to be displayed in the iframes. Any idea how to do this?
4
2798
by: Jon | last post by:
Hi, I have an iframe in a cell: <td id="contents" width="643"> <iframe width="643" height="232" src="home.asp" frameborder="0" scrolling="no"></iframe> </td> <td...
3
3780
by: f1crazed | last post by:
Hello, I am wanting to fire the onClick event of button1 by pressing button2. Does anyone have a clue if this is even posible? If so PLEASE HELP!! Thanks.
4
16413
by: Jerry Sievers | last post by:
JS Programmers, "I'm a server-side coder PHP, Postgres etc... My question; Given the following anchor <a href="http://www.somesite.com/somefile.html">link text</a> Is there a way to code an...
7
1134
by: Thomas | last post by:
Hi all! Currently I have a web application that consists of a classic frameset. I would like to rebuild the application and just use tables or layers. The problem is, that some parts of the...
4
1762
by: Pete | last post by:
Hello- I am have a real trying time finding information on this subject. I would like to create a web page that utilizes framesets (top & bottom) and a navigation control I created from a datalist...
0
1256
by: dhruba.bandopadhyay | last post by:
I know that it's possible to mix ASP & ASP.NET 1.1 in the same website/application so long as they are in separate frames (iframes). This also holds for mixing ASP & ASP.NET 2.0 pages. But what I...
8
4946
by: Dan Rumney | last post by:
All, I have a web page (copied below) with 3 images on it of fixed dimensions. Each image has a map associated with it In the maps, there are a number of areas with an onClick handler...
4
2921
by: ismailc | last post by:
Hi, I need help please. I need to create a textbox with a report url in an iframe below. Onclick of button create IFrame and pass textbox value into parameter of iframe src. I'm not to sure...
0
7260
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
7384
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
7537
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
7525
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
5685
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,...
0
4746
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...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1594
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 ...
0
456
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...

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.