Ver Mensaje Individual
  #3 (permalink)  
Antiguo 10/11/2015, 19:09
tjjow
 
Fecha de Ingreso: noviembre-2015
Ubicación: Con Alicia, en el país de las maravillas
Mensajes: 11
Antigüedad: 8 años, 6 meses
Puntos: 0
Respuesta: Como funciona este código? - JavaScript

Cita:
Iniciado por siddartha23 Ver Mensaje
Dentro de la función SaveToDisk() estas creando un enlace <a> y le defines sus propiedades normales: 'href' , 'target' y 'download', luego creas un evento y haces un trigger a ese evento usando el enlace que habías creado.

Espero haber solucionado tu duda existencial :)
Y está parte ?

Código:
var event = document.createEvent('Event');
        event.initEvent('click', true, true);
        save.dispatchEvent(event);
        (window.URL || window.webkitURL).revokeObjectURL(save.href);