1. 程式人生 > >bootstrap插件fileinput.js出現出現$("#xxxx").fileinput({}

bootstrap插件fileinput.js出現出現$("#xxxx").fileinput({}

bootstrap fileinput

如果出現$("#xxxx").fileinput({}); 不生效的情況需將fileinput.js中最後幾行註釋掉:

/ $(document).ready(function () {
var $input = $(‘input.file[type=file]‘), count = $input.attr(‘type‘) ? $input.length : 0;
if (count > 0) {
$input.fileinput();
}
});
/

    如果是fileinput.min.js,則需要將末尾部分的
    ,e(document).ready(function() { var t = e("input.file[type=file]");
    t.length && t.fileinput() }) 去掉

    或者,不要在 $(document).ready(function () {}) 中調用,
    否則不生效

bootstrap插件fileinput.js出現出現$("#xxxx").fileinput({}