473,382 Members | 1,743 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,382 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 4011


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
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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.