473,794 Members | 2,729 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(tab leObject) 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(ta bleToInsert)
{
document.getEle mentById("table Holder").append Child(tableToIn sert);
}

Aug 22 '06 #1
2 2973


strauchdieb wrote:

the code in my parent file looks like the following:
function SetDataTable(ta bleToInsert)
{
document.getEle mentById("table Holder").append Child(tableToIn sert);
}
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.appendChi ld(node1.ownerD ocument.importN ode(nodeFromOth erDocument,
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 insertAdjacentH TML method to insert the
markup of an element node e.g. for your example
document.getEle mentById("table Holder").insert AdjacentHTML('b eforeEnd',
tableToInsert.o uterHTML);

--

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
6693
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
16302
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 the browser. On the other hand, I could set it to some large value like 780px but that would be more of a hack than a real solution (when I resize the browser window to large proportion I can
5
3125
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 the defined contents of the TABLE element. The TR element is not defined as an "immediate" or "direct" contained element of TABLE. Given that
3
7898
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 Netscape). Is there any setting or anyother way to force the table element to fire the onfocus and onblur events? Thanks
0
1229
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" http://asp.net/webmatrix/guidedtour/Section15/codewizardinsert.aspx but Step 12 ..."Add an additonal row to the table (by right clicking on the Table and selecting the Add Table Row context menu item):"
0
1144
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, also with an IFRAME, I get the error 'The active schema does not support the element 'iframe'" when in design mode/HTML view. What could be causing this error in one page but not in the other? Thanks!
3
6200
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 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...
0
9671
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
9518
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
10000
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9035
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
7538
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
6777
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
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2919
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.