Hi everyone, I'm having problem getting this work in IE, the code works fine in Firefox.
The problem:
I'm opening a child window which goes to the parent window to get 2 tables, then I clone them and need to be appended to 2 divs in the child window.
The popup is being opening fine.
I'm already getting the 2 objects in the child window, but it seems the appendChild function isn't appending the elements into the divs.
Here is the code:
window.onload = function(){
// First Div
var divTitle = document.getElementById("tablaTitle");
// Second Div
var divTabla = document.getElementById("tabla");
//First table obtained from the parent window
var title = window.opener.document.getElementById("titleDataTable");
//Second table obtained from the parent window
var datatable = window.opener.document.getElementById(window.opener.document.getElementById("edsUnit").value);
//I'm declaring new var for both tables cloned...
var newTitle = title.cloneNode(true);
var newDT = datatable.cloneNode(true);
//...then I change their ids (This is working fine)
newTitle.id = 'popupTitle';
newDT.id = 'popuptable';
//Finally I append the tables into the divs (Maybe this needs more things to be defined in IE, but it works perfect in Firefox.
divTitle.appendChild(newTitle);
divTabla.appendChild(newDT);
}
Thx for any help!!!!!
Juan Pablo
The problem:
I'm opening a child window which goes to the parent window to get 2 tables, then I clone them and need to be appended to 2 divs in the child window.
The popup is being opening fine.
I'm already getting the 2 objects in the child window, but it seems the appendChild function isn't appending the elements into the divs.
Here is the code:
window.onload = function(){
// First Div
var divTitle = document.getElementById("tablaTitle");
// Second Div
var divTabla = document.getElementById("tabla");
//First table obtained from the parent window
var title = window.opener.document.getElementById("titleDataTable");
//Second table obtained from the parent window
var datatable = window.opener.document.getElementById(window.opener.document.getElementById("edsUnit").value);
//I'm declaring new var for both tables cloned...
var newTitle = title.cloneNode(true);
var newDT = datatable.cloneNode(true);
//...then I change their ids (This is working fine)
newTitle.id = 'popupTitle';
newDT.id = 'popuptable';
//Finally I append the tables into the divs (Maybe this needs more things to be defined in IE, but it works perfect in Firefox.
divTitle.appendChild(newTitle);
divTabla.appendChild(newDT);
}
Thx for any help!!!!!
Juan Pablo