Message from JavaScript discussions

February 2019

— Just call print()

— 

Jezuz, fetch API doesnt have timeout😱 https://stackoverflow.com/questions/46946380/fetch-api-request-timeout

— Hello guys, i wanna ask

— 

  $(".input").change(function(e) { 
readFile(this.files[0], function(e) {
//manipulate with result...
inisrc = e.target.result
// $('.img').attr('src', e.target.result);

} );

—> (this).closest(".parent").find(".img").attr('src', inisrc);

});

i want variable inisrc could be used at line that i have arrowed, how to do it?

Message permanent page

— No

— Anyone?

— Assign default value comrrade🤤 is readFile async? wat it does?

— 

function readFile(file, callback){
var reader = new FileReader();
reader.onload = callback
reader.readAsDataURL(file);
}

Message permanent page

— 

$(".input").change(function(e) {
var self = this;
readFile(this.files[0], function(e) {
// ...
// ...
$(self).closest(".parent").find(".img").attr('src', e.target.result);
});
});

Message permanent page

— Thank you work like charm

— Nice bro, now get the fuck out

— Https://en.wikipedia.org/wiki/Ponzi_scheme