上传文件过长中间显示省略号
if (docName.length > 16) { docName = docName.substring(0, 7) + "…" + docName.substring(docName.length - 7, docName.length); }
第二种亲亲老公(づ ̄3 ̄)づ╭❤~的方法:
if (val.length > 16) {
docName = docName.replace(/^(.{7}).+(.{7})$/, "$1...$2")
}