Foros del Web » Programando para Internet » Javascript »

boton que abre otra ventana

Estas en el tema de boton que abre otra ventana en el foro de Javascript en Foros del Web. Lo que yo pretendo es que cuando presione sobre botón me habra otra ventana. Tengo el siguiente código: <SCRIPT LANGUAGE="JavaScript"> function abrir(theURL,winName,features,param,target) { theURL = ...
  #1 (permalink)  
Antiguo 30/01/2002, 10:20
 
Fecha de Ingreso: diciembre-2001
Mensajes: 62
Antigüedad: 22 años, 4 meses
Puntos: 0
boton que abre otra ventana

Lo que yo pretendo es que cuando presione sobre botón me habra otra ventana. Tengo el siguiente código:

<SCRIPT LANGUAGE="JavaScript">
function abrir(theURL,winName,features,param,target)
{
theURL = theURL + param;
window.open(theURL,winName,features,target);
}
</script>

<form name="form1" method="post" action="">
<input name=Submit type=submit value=Enviar class="Texto" onClick="abrir('../ARTICULOS/enviar.asp?envio=','','location=0,width=1,height=1 ,top=0,left=0',2,'_blank')">
</form>

Pero lo que obtengo es que me habre la ventana en cuestion sobre la que tengo abierta.

Necesito ayuda, gracias.
  #2 (permalink)  
Antiguo 30/01/2002, 10:49
Avatar de Helbira  
Fecha de Ingreso: octubre-2001
Ubicación: Sevilla, España
Mensajes: 1.228
Antigüedad: 22 años, 6 meses
Puntos: 5
Re: boton que abre otra ventana

Quita el cuarto parámetro... ese te sobra:

window.open(theURL,winName,features,target );

Y te quedará:

window.open(theURL,winName,features);
  #3 (permalink)  
Antiguo 30/01/2002, 10:59
 
Fecha de Ingreso: diciembre-2001
Mensajes: 62
Antigüedad: 22 años, 4 meses
Puntos: 0
Re: boton que abre otra ventana

Ya lo he quitado y sigue sin abrirme una nueva ventana, lo hace sobre la misma.
  #4 (permalink)  
Antiguo 01/02/2002, 03:34
 
Fecha de Ingreso: febrero-2002
Mensajes: 15
Antigüedad: 22 años, 2 meses
Puntos: 0
Re: boton que abre otra ventana

Prueba lo siguiente:

var hWnd;
hWnd=window.open(theURL,winName,features);
if (!hWnd.opener) hWnd.opener = self;
hWnd.focus();
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 18:42.