jq监听input type="file"发生改变,即选择文件

 $("#img_file").change(function() {
            jQuery.ajaxFileUpload({
                   
                 console.log(888)
        })
<input type="file" name="file" id="img_file">

 

 

不需要点击上传文件按钮,直接判断type="file"是否发生改变,即是否选择了图片,当发生改变时,直接调用后台上传图片接口

posted @ 2020-08-06 18:16  碧果果  阅读(4871)  评论(0编辑  收藏  举报