/** 获取文件后缀 
             * 
             * indexOf 和 lastIndexOf 都是索引文件
             indexOf 是查某个指定的字符串在字符串首次出现的位置(索引值) (也就是从前往后查)
               lastIndexOf 是从右向左查某个指定的字符串在字符串中最后一次出现的位置(也就是从后往前查)
            */
            function getType( file ){
                var file = file;
           var type = file.substring(file.lastIndexOf(".")+1,file.length);
                return type;
            }

相关文章:

  • 2021-09-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-31
  • 2021-07-20
  • 2021-08-24
  • 2021-07-19
相关资源
相似解决方案