方法如下代码: var address= "http://2020-4-25/cn/62888.jpg"; var fileName = address.substring(address.lastIndexOf('.') + 1); 做项目中用到的判断记录一下: