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

Can't move a complex object from one frame to another

All,

I am trying to implement JavaScript that will remove a table row in frame [left],
and append it to a table in frame [right]. The browser is IE6.

I've played with several approaches for quite a bit of time, but none of them seem
to work. The removed row does not seem to be able to go across the frame boundaries.

Here is the code in the target frame [right] that is invoked by a button in
frame [left]:

function move_all()
{
var parentElement = window.parent.tleft.document.getElementById("tbody _left");
var parentElement1 = window.parent.tleft.document.getElementById("tbody _left1");
var referencedMode = document.getElementById("tbody_right");
{
removedEl = parentElement.removeChild(parentElement.childNodes[0]);
var newtr = removedEl.cloneNode(true);
parentElement1.appendChild(newtr);
/* referencedMode.appendChild(newtr); - DOES NOT WORK ... */
parentElement1.appendChild(removedEl);
}
}

My attempt to append the newtr object to frame [right] returns "Invalid argument".
Appending the same thing to another table in frame [left] works just fine,
as well as appending the original removed row {removedEl} to that table.

Does anyone have any suggestions? How can I move a copy of a complex object
from one frame to another?

Thanks,
Konstantin
Jul 20 '05 #1
1 4012


Konstantin Kudin wrote:
All,

I am trying to implement JavaScript that will remove a table row in frame [left],
and append it to a table in frame [right]. The browser is IE6.

I've played with several approaches for quite a bit of time, but none of them seem
to work. The removed row does not seem to be able to go across the frame boundaries.

Here is the code in the target frame [right] that is invoked by a button in
frame [left]:

function move_all()
{
var parentElement = window.parent.tleft.document.getElementById("tbody _left");
var parentElement1 = window.parent.tleft.document.getElementById("tbody _left1");
var referencedMode = document.getElementById("tbody_right");
{
removedEl = parentElement.removeChild(parentElement.childNodes[0]);
var newtr = removedEl.cloneNode(true);
parentElement1.appendChild(newtr);
/* referencedMode.appendChild(newtr); - DOES NOT WORK ... */
parentElement1.appendChild(removedEl);
}
}

My attempt to append the newtr object to frame [right] returns "Invalid argument".
Appending the same thing to another table in frame [left] works just fine,
as well as appending the original removed row {removedEl} to that table.

Does anyone have any suggestions? How can I move a copy of a complex object
from one frame to another?


Unfortunately IE (at least IE5/5.5/6 on Win) doesn't support what the
W3C DOM Level 2 suggests for that, namely the method
importNode
see
http://www.w3.org/TR/DOM-Level-2-Cor...tml#i-Document
So you would either write some importNode yourself or you would need to
use IE's DOM with copying the outerHTML of the elements using
insertAdjacentHTML
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

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

Similar topics

9
by: F. Da Costa | last post by:
Hi, Does anybody know why IE5+ does *not* honour array objects (like a table) across a session? Example: Frame A contains a var tableVar which is set via form Frame B (on init) using...
26
by: Dave Hammond | last post by:
In document "A.html" I have defined a function and within the document body have included an IFRAME element who's source is document "B.html". In document "B.html" I am trying to call the function...
39
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. ...
0
by: davidchildreth | last post by:
It would make my clients life easier if he could place attached file into an unbound object frame on a form. This activity causes bloat if there are many such insertions. I would like to...
1
by: Todd7 | last post by:
I am writing a python program to load a pdf file into an IEHtmlWindow which displays it through adobe acrobat reader 7. Depending on the buttons the user clicks, the program moves it to another...
37
by: jht5945 | last post by:
For example I wrote a function: function Func() { // do something } we can call it like: var obj = new Func(); // call it as a constructor or var result = Func(); // call it as...
2
by: The Natural Philosopher | last post by:
I am trying to get a fairly complex database form set up..at various stages I need to open popups to edit subsections, then close them.. Now this all works fine from the main screen, I can open a...
4
by: camarkco | last post by:
Why does C# go out of it's way to prevent this? Mark
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...
0
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
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...
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...
1
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
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
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...

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.