开发者

Preview image for IE

开发者 https://www.devze.com 2023-03-28 15:40 出处:网络
I have script which shows me image in django form before I click submit. function upload_img(input, id) {

I have script which shows me image in django form before I click submit.

        function upload_img(input, id) {
            if (input.files && input.files[0]) {
                var reader = new FileRead开发者_如何学Cer();
                reader.onload = function (e) {
                    $(id).attr('src', e.target.result);
                }
                reader.readAsDataURL(input.files[0]);
            }
        };

But it does not work for IE 9. Can I make it work for this browser?


IE 9 doesn't support FileReader but you can use this

0

精彩评论

暂无评论...
验证码 换一张
取 消