473,378 Members | 1,309 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,378 software developers and data experts.

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 6160

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.contentWindow 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.createElement('IFRAME');
contents.src = "detailBox.html";
contents.contentDocument.getElementById("detail"). appendChild(newEl);
boxdiv.appendChild(contents);
document.body.appendChild(boxdiv);
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.createElement('IFRAME');
contents.src = "detailBox.html";
contents.contentDocument.getElementById("detail"). appendChild(newEl);
boxdiv.appendChild(contents);
document.body.appendChild(boxdiv);
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
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. ...
5
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...
1
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,...
7
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. ...
2
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...
1
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...
3
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...
1
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...
0
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.