jquery ajax 文件上传配置

   var fd = new FormData;
        fd.append('file', document.getElementById('f').files[0]);
        //console.log(fd.get('file'));
        $.ajax({
            type: 'post',
            url: "http://admin.crazy.com/feedback",
            data: fd,
            processData: false, // 默认 | 不处理数据
            contentType: false, // 默认 | 不设置内容类型
            success: function (res) {
                console.log(res);
                var data = res.data;

            }
        });
上一篇 css3背景颜色渐变动画
下一篇 vue实现可拖拽排序的列表