Ver Mensaje Individual
  #7 (permalink)  
Antiguo 01/09/2007, 22:44
Avatar de derkenuke
derkenuke
Colaborador
 
Fecha de Ingreso: octubre-2003
Ubicación: self.location.href
Mensajes: 2.665
Antigüedad: 21 años, 4 meses
Puntos: 45
Re: Evento Doc. Load para IE (via DOM)

Hola de nuevo.

Utilizando tu misma función addListener() sí me ha dejado agregar eventos al window.onload. Lo que ocurre es que IE ejecuta primero el último agregado, y FF el primero agregado es el primero ejecutado:

Código PHP:
<!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" xml:lang="es" lang="es">
<
head>
<
meta http-equiv="Content-type" content="text/html;charset=iso-8859-1" />
<
meta name="Author" content="derkeNuke" />
<
title>P&#225;gina nueva</title>
<style type="text/css">

</
style>
</
head>

<
body>

<
script type="text/javascript">

//
// Función para aplicar un evento
//
function addListener(ObjeventeventHandler) {

    if( 
Obj.addEventListener ) {
        
Obj.addEventListener(eventeventHandlerfalse);
    } else if( 
Obj.attachEvent ) {
        
Obj.attachEvent("on"+eventeventHandler);
    }
}

addListenerwindow"load", function() {
    
alert("hola");
} );
addListenerwindow"load", function() {
    
alert("adios");
} );

</script>

</body>
</html> 
Tanto en IE6 como en FF2.


Un saludo.
__________________
- Haz preguntas inteligentes, y obtendrás más y mejores respuestas.
- Antes de postearlo Inténtalo y Búscalo.
- Escribe correctamente tus mensajes.