Jquery图像上传无法在Firefox中运行

时间:2013-12-30 08:27:37

标签: jquery performance jquery-ui

图片上传第一次在firefox中无法正常工作,但它在谷歌Chrome中的工作正常如何解决这个问题我还需要限制图像格式我如何限制在此代码中请帮助我的朋友。 。 。

     $('#imgInp').focusout(function () {

            function readURL(input) {
                if (input.files && input.files[0]) {
                    var reader = new FileReader();

                    reader.onload = function (e) {
                        $('#blah').attr('src', e.target.result);
                    }

                    reader.readAsDataURL(input.files[0]);
                }
            }
            $("#imgInp").change(function () {
                if ($('#imgInp').val() != "No file chosen") {
                    readURL(this);
                }
                else {
                    alert("Insert Photo");
                }
            });
        });

0 个答案:

没有答案