Ver Mensaje Individual
  #8 (permalink)  
Antiguo 24/09/2014, 16:16
Avatar de IsaBelM
IsaBelM
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 5.032
Antigüedad: 15 años, 10 meses
Puntos: 1012
Respuesta: xmlhttpRequest con addEventListener y múltiples argumentos

no veo el objeto de preguntar si no tomas en cuenta nada de lo que se te dice. y peor aún, no veo sentido a intentar ayudate. de tal modo que esta será mi última intervención en este tema

haré algo que tu no has hecho, probar para ver si funciona
Cita:
var nuar = 0;

function subirArchivo() {
var archivos = 3;
for(var i = 0; i< archivos; i++){
nuar += 1;
document.querySelectorAll('.p')[i].addEventListener('click', function(event){progreso(event, nuar)}, false);
}
}

function progreso(event,nuar){
console.log(nuar); // valores 3,3,3
}


window.addEventListener('load', subirArchivo, false);
Cita:
function subirArchivo() {
var archivos = 3;
for(var i = 0; i< archivos; i++){
(function(i) {
document.querySelectorAll('.p')[i].addEventListener('click', function(event){progreso(event, i)}, false);
})(i)
}
}

function progreso(event,nuar){
console.log(nuar); // valores 0,1,2
}


window.addEventListener('load', subirArchivo, false);
te lo doy mascado

Cita:
<span class="p" style="margin-right: 30px; width:100px; height:100px">1</span>
<span class="p" style="margin-right: 30px; width:100px; height:100px">2</span>
<span class="p" style="margin-right: 30px; width:100px; height:100px">3</span>
__________________
if(ViolenciaDeGénero) {alert('MUJER ASESINADA');}