Ver Mensaje Individual
  #12 (permalink)  
Antiguo 26/04/2013, 18:31
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: llamar funcion click de una ventana padre

Cita:
Iniciado por elasesino_broly Ver Mensaje
tus ejemplos los pruebo y funcionan

pero en lo que estoy haciendo al hacer appendChild del boton a opener.document.table

no inserta el boton... en ie<=8...
PAra que funcione hay que hacerlo asi
Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>titulo</title> 
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript">
//<![CDATA[

function crearBoton(){
var body_padre = window.opener.document.body;
var botonx=body_padre.document.createElement("BUTTON");
botonx.id = "boton";
botonx.title = "titulos del botón creado";
botonx.innerHTML = "boton con atributos agregados";
botonx.onclick = function(){
opener.nombreFuncion(this);
};
body_padre.appendChild(botonx);
}
//]]>
</script>
</head>
<body>
<button onclick="crearBoton()">Crear Botón</button><br />
</body>
</html>
faltaría solucionar el tema de que si la ventana se cierra la función nombreFuncion() ya no se ejecuta
voy a analizarlo un poco


Ah, un detalle importante, en Ie y Chrome no trabaja en local
Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.

Última edición por emprear; 26/04/2013 a las 18:36