Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery图像上传在firefox中不起作用_Jquery_Performance_Jquery Ui - Fatal编程技术网

Jquery图像上传在firefox中不起作用

Jquery图像上传在firefox中不起作用,jquery,performance,jquery-ui,Jquery,Performance,Jquery Ui,图片上传不是第一次在firefox中工作,但是在google chrome中工作很好。如何解决这个问题,我还需要限制图片格式。在这段代码中,我如何限制图片格式请帮助我的朋友 $('#imgInp').focusout(function () { function readURL(input) { if (input.files && input.files[0]) { va

图片上传不是第一次在firefox中工作,但是在google 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");
                }
            });
        });

你在firefox上调试过吗?如果是,您是否有任何异常?否,第一次图像未上载,第二次图像上载到Firefox中,因此在调试时,您不会得到任何错误。只是图像没有上传与第一。我理解的对吗?是的,你是对的。