A lo mejor el siguiente ejemplo te sirve
PAGINA PRINCIPAL
Código HTML:
Ver original<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> function appendTr(datos) {
var tbody = document.getElementById("tbDetalle");
var tr = document.createElement("tr");
var td = document.createElement("td");
td.innerHTML = datos.los;
tr.appendChild(td);
tbody.appendChild(tr);
}
var day = new Date();
var id = day.getTime();
var URL = 'popup.html';
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=400');");
Y ESTO EN popup.html
Código HTML:
Ver original<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> function appendToPrincipal() {
var datos = {"los" : "los datos que sean"};
window.opener.appendTr(datos);
}
<input type="button" value="añadir en la principal" onclick="appendToPrincipal();" />