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

add table element from iframe to parent

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 table. now i add
the table with appendChild(tableObject) to that element. this call
works in firefox but don't work in ie. what's wrong with that? can
anyone help?

the code in my parent file looks like the following:
function SetDataTable(tableToInsert)
{
document.getElementById("tableHolder").appendChild (tableToInsert);
}

Aug 22 '06 #1
2 2926


strauchdieb wrote:

the code in my parent file looks like the following:
function SetDataTable(tableToInsert)
{
document.getElementById("tableHolder").appendChild (tableToInsert);
}
IE currrently has no support to insert a HTML DOM node from one document
into another HTML document.
The W3C wants you to do

node1.appendChild(node1.ownerDocument.importNode(n odeFromOtherDocument,
true))
but IE does not support that importNode method. Mozilla and Opera
support importNode but Mozilla and Opera 9 (but not Opera 8) will not
complain if you don't use importNode but simply move nodes between
documents with appendChild.

For IE all you can do is use its insertAdjacentHTML method to insert the
markup of an element node e.g. for your example
document.getElementById("tableHolder").insertAdjac entHTML('beforeEnd',
tableToInsert.outerHTML);

--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 22 '06 #2
thx martin.
that works for me.

Aug 22 '06 #3

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

Similar topics

2
by: gsb | last post by:
I have an HTML page loaded into an iFrame contained in a DIV tag. From the loaded document how would I reference the DIV object? Thanks, gsb
4
by: Neil Zanella | last post by:
Hello, Consider the height property in the code shown below... I am dissatisfied with the height propery. When I set it to 100% the table does not fill the entire vertical space available to...
5
by: Patient Guy | last post by:
In my reading of the Strict and Transitional DTD for HTML 4.0, the table row (TR) elements are contained within table section elements: THEAD, TFOOT, and TBODY. The table section elements are...
3
by: Praveen | last post by:
In IE a table element will receive focus when you either tab into it or when you click anywhere within the table. Mainly it fires the onfocus event. This doesn't happen in Mozilla (Firefox and...
0
by: Richard Fagen | last post by:
Hi Everyone, I'm trying to drag a table element and add a row. This sounds simple enough and I followed the steps in the "Web Matrix Guided Tour" ...
0
by: TR | last post by:
I have two aspx pages. Both pages have the same DOCTYPE: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> On one, there's an IFRAME and it works without no error. On the other,...
3
by: jeet_sen | last post by:
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...
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: 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
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.