Created
November 21, 2017 03:23
-
-
Save fengt/ea3dd238f248751c910e82a74ad39f8a to your computer and use it in GitHub Desktop.
Revisions
-
fengt created this gist
Nov 21, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ $('#upload_btn').on('click', function() { var uploadFile = $('#upload_categories').val(); if (!uploadFile) { alertify.log('请先选择文件!', 'error', 0); return; } var fileName = uploadFile.substr(uploadFile.lastIndexOf('\\')+1); var ary = ['xls', 'xlsx']; var suffix = uploadFile.split('.').pop().toLowerCase(); if ($.inArray(suffix, ary) == -1) { alertify.log('文件类型有误,请上传excel文件!', 'error', 0); return; } $('#upload_category_form').submit(); });