473,804 Members | 3,762 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Display table within IFRAME

Hi,
I have a some data in the form of a table to displayed as small pop
up frame.
For this I have used an Iframe which is created dynamically. Then I
created a table element and added as a child of the the iframe. Though
the frame is getting displayed but its empty without any table.
Can a table element be added as a child of an iframe?
Or Iframe can only read data from a source html mentioned with src
attribute.
Can anyone throw some light on it?

Regards,
Suvajit

Mar 17 '06 #1
3 6200

jeet_sen wrote:
Hi,
I have a some data in the form of a table to displayed as small pop
up frame.
For this I have used an Iframe which is created dynamically. Then I
created a table element and added as a child of the the iframe. Though
the frame is getting displayed but its empty without any table.
Can a table element be added as a child of an iframe?
Or Iframe can only read data from a source html mentioned with src
attribute.
Can anyone throw some light on it?

Regards,
Suvajit


Objects displayed in the iframe are not children of iframe. They are
children of the document loaded in the iframe. Therefore instead of
f.appendChild(. ..); you have to use
f.contentWindow .document.body. appendChild(... );

"f" - means iframe object.

Mar 17 '06 #2
Hi marss,
Thanks a lot for your help. I tried it out.
But Its is saying that "f.contentWindo w has no properties" .
My source html is as follows:
<html>
<head>
<title>QC run details</title>
<link rel="StyleSheet " href="../css/detailBox.css" type="text/css">
<script type="text/javascript"
src="../scripts/detailBox.js"></script>
</head>
<body>
<h2>Details of TurboChar QC run:</h2>
<div id="detail"></div>
</body>
</html>

And i wanted to add the table object to div element detail.
The syntax is as follows:
var contents = document.create Element('IFRAME ');
contents.src = "detailBox.html ";
contents.conten tDocument.getEl ementById("deta il").appendChil d(newEl);
boxdiv.appendCh ild(contents);
document.body.a ppendChild(boxd iv);
where
my newEl is the TABLE object,
boxdiv is a div object with which my iframe is associated

What can I be missing ?

Regards,
Suvajit

Mar 17 '06 #3
VK

jeet_sen wrote:
And i wanted to add the table object to div element detail.
The syntax is as follows:
var contents = document.create Element('IFRAME ');
contents.src = "detailBox.html ";
contents.conten tDocument.getEl ementById("deta il").appendChil d(newEl);
boxdiv.appendCh ild(contents);
document.body.a ppendChild(boxd iv);
where
my newEl is the TABLE object,
boxdiv is a div object with which my iframe is associated What can I be missing ?


You are missing the fact that until iframe is added and it's content is
loaded, it doesn't have any id's from detailBox.html. On this stage it
is just an abstract DOM "iframe" object with "src" string property set
to "detailBox.html ".

You need to go from the opposite direction: detailBox.html template has
to have onload handler to query opener/ownerDocument for data and
append it.

Mar 17 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1745
by: Dennis M. Marks | last post by:
I have a function that displays a list extracted from a table using document.write. In the displayed list I want to have a link that will call the same function but display the list in reverse. Click HERE to reverse A B C When HERE is clicked the page will redisplay as
5
2518
by: Victor | last post by:
Hi I need to open an html file from the file system and embed that html file within my main aspx form. I have 2 questions: 1) How do I open the html file? I tried the File.open(Path, mode) didnt work. 2) I would like to display the html file at a certain location in my main aspx page. How can I achieve this? I'm brain dead and I have to finish this tonight! Please help. Thanks
1
1312
by: Jason Goh via .NET 247 | last post by:
Hi, I was wondering how do I display a XML file within HTML coding in an aspx page. I would need to preserve the functionality of the XML file with all the '+' and '-' features. For example, I need to display the XML file in an HTML table. Thanks! --------------------------------
7
6398
by: TLM | last post by:
I am trying to build a web application that will contain links to files on a users local computer. I am assuming that the files will be in a known location and can display in a browser window. I have my ASP.NET application building links along the lines of file://c:/<path to file>
2
2974
by: strauchdieb | last post by:
hi, i have a non-visible iframe on my page. in that iframe i load data in a htmltable. if the data is ready, i want to take this table out of the iframe and insert it in the parent. as soon as the data is ready, i call a js.-method in my parent from within the iframe. this method has one parameter, the table object. no my problem: in my parent i get the specific parent element with getElementById("elementId"), in which i will add my...
1
4533
by: rbinington | last post by:
Hi, I am trying to write a DNN module that has the ability to insert articles into an article repository. I want the users to be able to move pages around and enter text into the FCKEditor. I want only one instance of the FCKEditor on the screen at one time so I make tabs that the user can click and I store the values in variables behind the scenes. I change the CSS class on the link that is the currently selected one. I have a really...
3
11792
by: Chandra | last post by:
Hi All, I have 2 htmls with one being referred in iframe of the other. The iframe html has style display = block and none set in the javascript. however this makes the block go behind the parent html contents and not on top of it. Any idea how to resolve this? Thanks, Chandra
1
990
by: jalicej | last post by:
I need to display a user control inside a label. Inside this label there are many other thing also to be displayed. So i have used a table for that. The coding which i have used is : Label1.Text += "<table><tr><td><iframe src=vendor.aspx?surid=" + lngSurveyID + "&itemid=" + lngItemID + " height=250 width=700 frameborder=0></iframe></td> </tr> Label1.Text += <tr><td> <uc1:Compare2 intItemId = '312' intSurveyId= '645' ID='Compare2_1'...
0
1510
by: johnw182 | last post by:
Ok, I have a asp.net project. Everything works great. HOWEVER, this project was made to be called from within a frame or iframe. When being used within the iframe the user gets a blank frame when clicking certian buttons. Here is the code for the iframe. <iframe src="http://www.website.com/?cid=A195E1A9-A5D7-4046-89A4-1C00D4F81E35" id="frameName" frameborder="0" width="550" height="750"></iFrame> Here are the steps taken to reproduce.
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
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
10571
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
10326
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
10317
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,...
1
7615
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
6851
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
5520
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
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.