Ver Mensaje Individual
  #13 (permalink)  
Antiguo 02/05/2012, 13:51
chinanzio
 
Fecha de Ingreso: marzo-2007
Mensajes: 82
Antigüedad: 17 años, 2 meses
Puntos: 21
Respuesta: El DOM y Ventanas secundarias

A lo mejor el siguiente ejemplo te sirve

PAGINA PRINCIPAL
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  4. <title>Insert title here</title>
  5. </head>
  6.     <table>
  7.         <tbody id="tbDetalle">
  8.         <tr>
  9.             <td>uno</td>
  10.         </tr>
  11.         <tr>
  12.             <td>dos</td>
  13.         </tr>
  14.         </tbody>
  15.     </table>
  16.     <script>
  17.     function appendTr(datos) {
  18.         var tbody = document.getElementById("tbDetalle");
  19.  
  20.         var tr = document.createElement("tr");
  21.         var td = document.createElement("td");
  22.         td.innerHTML = datos.los;
  23.         tr.appendChild(td);
  24.  
  25.         tbody.appendChild(tr);
  26.     }
  27.  
  28.     var day = new Date();
  29.     var id = day.getTime();
  30.     var URL = 'popup.html';
  31.     eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=400');");
  32.        
  33.     </script>
  34. </body>
  35. </html>

Y ESTO EN popup.html
Código HTML:
Ver original
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5. <title>Insert title here</title>
  6. </head>
  7. function appendToPrincipal() {
  8.     var datos = {"los" : "los datos que sean"};
  9.     window.opener.appendTr(datos); 
  10. }
  11. <input type="button" value="añadir en la principal" onclick="appendToPrincipal();" />
  12. </body>
  13. </html>
__________________
Hazle un favor a tu cerebro y juega Ajedrez online
Chess online