Foros del Web » Programando para Internet » Javascript »

instruccion opener

Estas en el tema de instruccion opener en el foro de Javascript en Foros del Web. Hola a todos, les cuento que tenia en mi pagina una llamada a un calendario en la que utilizaba esta instruccion : document.write(Calendar(opener.month,opener.year)) , y ...
  #1 (permalink)  
Antiguo 11/05/2004, 07:24
 
Fecha de Ingreso: mayo-2004
Mensajes: 4
Antigüedad: 20 años
Puntos: 0
instruccion opener

Hola a todos,
les cuento que tenia en mi pagina una llamada a un calendario en la que utilizaba esta instruccion :
document.write(Calendar(opener.month,opener.year)) ,

y ahora me dice que tengo acceso denegado.

Sin alguien me puede dar alguna pista....gracias
  #2 (permalink)  
Antiguo 11/05/2004, 15:35
Avatar de PatomaS
Colaborador
 
Fecha de Ingreso: marzo-2004
Ubicación: En alguna otra parte
Mensajes: 4.656
Antigüedad: 20 años, 1 mes
Puntos: 63
Hola

Pues habría que ver el sitio completo, la ventana en la que tienes esta instrucción y la que la abrió.

De entrada te comento, opener se refiere a la ventana que abrió la actual, así que si colocas ese código en una página que no ha sido abierta por otra, tiene que fallar.

Suerte

Felicidad
__________________
¡ hey, hou, hou, hey !
  #3 (permalink)  
Antiguo 12/05/2004, 13:57
 
Fecha de Ingreso: mayo-2004
Mensajes: 4
Antigüedad: 20 años
Puntos: 0
Hola PatomaS,

te envio el codigo:
programa que llama

<SCRIPT TYPE="text/javascript" LANGAUGE="JavaScript"><!--
function y2k(number) { return (number < 1000) ? number + 1900 : number; }

var today = new Date();
var day = today.getDate();
var month = today.getMonth();
var year = today.getFullYear();
function padout(number) { return (number < 10) ? '0' + number : number; }

function restart() {
document.grabar_paciente.v_fecha1.value = ' ' + padout(day) + '/' + padout(month - 0 + 1) + '/' + year;
mywindow.close();
}
function newWindow() {
mywindow=open('http://cal.htm','Calendario','resizable=no,width=420,heig ht=220');
mywindow.location.href = 'http://condor.utalca.cl/clinica/librerias/cal.htm';
if (mywindow.opener == null) mywindow.opener = self;
}


<td width="5%" class="td_ppto_izq">Fecha Nacimiento:</td>
<td width="10%" class="td_ppto_izq">
<INPUT TYPE="text" NAME="v_fecha1" SIZE="11" MAXLENGTH="10" VALUE="26-03-2004" class="td_ppto_total" onfocus="this.blur(444)">
<br>
<input type=button value="Calendario" onclick="newWindow()">
</td>


cal.htm
<BODY BGCOLOR="#C0C0C0" TOPMARGIN=2 LEFTMARGIN=5>

<P><CENTER>

<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
document.write(Calendar(window.opener.month,window .opener.year));
</SCRIPT>

</CENTER>
</BODY>
</HTML>

te estaria muy agradecido por alguna pista, he hecho varios cambios tratando que vuelva a funcionar.

Saludos.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 11:44.