Bootstrap-FileInput插件使用方法

页面引用




JavaScript

$(function () {
        var id = '${lid}';
        $('#file-zh').fileinput({
            language: 'zh',
            uploadUrl: '/loan/upload/' + id + '.shtml',
            showPreview: false,
            elErrorContainer: "#fileError",
            browseClass: "btn btn-success btn-file btn-sm",
            browseLabel: "查找文件",
            browseIcon: '',
            removeClass: "btn btn-danger btn-file btn-sm",
            removeLabel: "清除",
            removeIcon: '',
            uploadClass: "btn btn-info btn-file btn-sm",
            uploadLabel: "上传",
            uploadIcon: ''
        })
            .on("fileuploaded", function (e, data) {
                var res = data.response;
                if (res.code == 200) {
                    location.href = res.url;
                }
            });
    })

你可能感兴趣的:(Bootstrap-FileInput插件使用方法)