html - Javascript code only works in debugging Mode in Internet Explorer -
i've tryed execute next block of code, worked in internet explorer debugging mode open. haven't added console.log or that. problem? in google chrome , firefox works fine without opening debugging mode. working 64 bit version of internet explorer:
var validation = false; var val = $('#profilepicture')[0].value; var regex = new regexp("(.*?)\.(jpg|jpeg|bmp|png|tif)$"); if (regex.test(val)) { validation = true; } else { errordialog('extension not allowed', null); $('#profilepicture').val(''); $('#profileimage').val(''); $("#sicform .bootstrap-filestyle > input").val(""); document.getelementbyid('profileimage').src = "images/sat-placeholder.png"; } var tgt = evt.target || window.event.srcelement, files = tgt.files; var uploadcontrol = document.getelementbyid('profilepicture'); if (uploadcontrol.files[0].size > 2097152 || validation != true) { errordialog('file exceeds upload limit', null); $('#profilepicture').val(''); $('#profileimage').val(''); $("#sicform .bootstrap-filestyle > input").val(""); document.getelementbyid('profileimage').src = "${ctx}/images/sat-placeholder.png"; } else { if (filereader && files && files.length) { var fr = new filereader(); fr.onload = function() { document.getelementbyid('profileimage').src = fr.result; } fr.readasdataurl(files[0]); } }
Comments
Post a Comment