0

We are facing a problem in bootstrap modal(that modal contents four images).When we click on choose file button then using jquery we just put that image on the modal.We have used the following code to put the image on the modal.

var filerdr = new FileReader();
filerdr.onload = function (e) {
    //alert(e.target.result);
    $('#imageprvw_deal').attr('src', e.target.result);
    jQuery('#imageprvw_deal').nailthumb({
        width: 200, height: 300
    });
}
filerdr.readAsDataURL(input.files[0]);

After that we click on a "dispaly preview" button and that modal comes with that image.At this time modal freezed and the screen hanged.We are facing this problem only in google chrome.In firefox its working perfectly.If any one have any idea what is happening here please help us.Thanks in advance.

Siguza
  • 21,155
  • 6
  • 52
  • 89
debojit
  • 1
  • 1

1 Answers1

0

If you are using Chrome, the code has to be running on a server (localhost or via an actual site). It won't work with a local file. Here is a Stackoverflow article with more information that may be helpful: Chrome FileReader.

Community
  • 1
  • 1
cfnerd
  • 3,658
  • 12
  • 32
  • 44