Ver Mensaje Individual
  #2 (permalink)  
Antiguo 16/07/2012, 13:17
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: No detecta change desde ventana hija

No entiendo bien del todo, pero te dejo un modelo de como recibir variables desde hija a padre

padre.html
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <title>Padre</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. <script type="text/javascript">
  7. <!--
  8. var nuevaVentana = null;
  9. function abrirNuevaVentana(){
  10. if ((nuevaVentana != null) && (nuevaVentana.closed == false)){
  11. if( nuevaVentana.closed == false )
  12. nuevaVentana.close();
  13. nuevaVentana = null;
  14. }
  15.  
  16. var abrirUrl = 'hija.html';
  17. var nombreVentana = 'NewWindow_' + new Date().getTime();
  18. var carcateristicasVentana ='width=1000px,height=700px';
  19.  
  20. nuevaVentana = window.open(abrirUrl, nombreVentana, carcateristicasVentana);
  21. if(parseInt(navigator.appVersion) >= 4){nuevaVentana.window.focus();}
  22.  
  23. if (nuevaVentana) {
  24.    var isChrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
  25.    if (isChrome && nuevaVentana.parent) {
  26.        nuevaVentana.parent.blur();
  27.    }
  28.    nuevaVentana.focus();
  29. }
  30. }
  31.  
  32. function llamarFuncionEnHija(){
  33. if((nuevaVentana != null) && (nuevaVentana.closed == false)){
  34. if(parseInt(navigator.appVersion) >= 4){
  35. nuevaVentana.window.focus();
  36. }
  37. nuevaVentana.funcionEnHija('pasado desde parent');
  38. }else{
  39. alert('Abrir el popup primero');
  40. }
  41. }
  42. // -->
  43. </head>
  44. <button onclick="abrirNuevaVentana();">abrir pop</button>
  45. <button onclick="llamarFuncionEnHija();">Recibir resultados de función en hija</button>
  46. </body>
  47. </html>

hija.html
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <title>hija</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. <script type="text/javascript">
  7. //<![CDATA[
  8. function funcionEnHija(valordesdeparent){
  9. alert(valordesdeparent + ' - ' +document.getElementById('prueba').value);
  10. }
  11. //]]>
  12. </head>
  13. Rellenar campo y llamar otra vez desde parent con 'Recibir resultados de función en hija'<br />
  14. sin cerrar esta ventana.
  15. <input type="text" value="" id="prueba"/>
  16. <input type="button" value="Cerrar" onclick="self.close()" />
  17. </body>
  18. </html>

Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.