Ver Mensaje Individual
  #6 (permalink)  
Antiguo 26/04/2013, 15:25
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

No es un problema del opener precisamente
para ie < 8 no funciona para cualquier atributo, si querés agregar un evento podés utilizar esto

Código HTML:
<!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 sa(){
var boton=document.getElementById('boton');
boton.setAttribute('title','Título Agregado');
if(navigator.userAgent.indexOf("MSIE 7.0") != -1){
boton.onclick = function(){eval(nombreFuncion(this)); };
}else{
boton.setAttribute('onclick','nombreFuncion(this)');
}
}

function nombreFuncion(elemento){
alert(elemento.id);
}
//]]>
</script>

</head>
<body>
<button onclick="sa()">Agrega atributos</button>
<button id="boton">boton con atributos agregados</button>
</body>
</html> 
Fijate que el "title" si lo agrega
si preferís no usar eval vas a tener que utillizar attachEvent.
Aqui te dejo un ejemplo de uso (en ie > 8 se utiliza addEventListener)

http://www.forosdelweb.com/f13/addev...2/#post4377485

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