Ver Mensaje Individual
  #3 (permalink)  
Antiguo 14/12/2012, 06:36
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 17 años
Puntos: 1567
Respuesta: Código que funciona en explorer pero no en Chrome

En el primer script es una restricción de seguridad de chrome, con haber visto la consola te hubieses dados cuenta

Cita:
Unsafe JavaScript attempt to access frame with URL file:///R:/open_pop_select.html from frame with URL file:///R:/pop_select.html. Domains, protocols and ports must match.
es decir, la script no corre desde file://, necesitar ejecutarla desde http.
Y te recomendaría que en casos así, además muestres un poco más detallado tu html, si no uno tiene que estar recreando y reconstruyendo archivos


abrir el pop
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>titulo</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. </head>
  7.     <button onclick="window.open('pop_select.html','nv','width=450,height=450');">pop</button>
  8. <form action="#">
  9. numdoc: <input type="text" value="" id="num_doc" /><br />
  10. tipodoc: <input type="text" value="" id="tipo_doc" /><br />
  11. </form>
  12. </body>
  13. </html>

el pop
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>titulo</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. </head>
  7. <form action="#">
  8. <select id="resultados" name="resultados" size="1" onchange = "opener.document.getElementById('num_doc').value = this.value;opener.document.getElementById('tipo_doc').value = document.getElementById('tipo').value; self.close()"  >
  9. <option value="A">A</option>
  10. <option value="B">B</option>
  11. tipo: <input type="text" value="" id="tipo" />
  12. </form>
  13. </body>
  14. </html>

En tú código esto no tiene que funcionar ni siquiera en IE (sólo completará el primer campo, pero no el segundo ni cerrará la ventana)

this.document.getElementById('tipo').value

por un lado no has definido el campo tipo (tu html está incompleto), por el otro, el this, te sobra porque se aplica al select, y yo adivino, a falta de otro dato, que tenés otro campo con id=tipo, tal cual puse en mi ejemplo


en el segundo script supongo debe pasar algo similar
Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.