SyntaxFix
Write A Post
Hire A Developer
Questions
This is the solution if your file has more . (dots) in the name.
<script type="text/javascript">var x = "file1.asdf.txt"; var y = x.split("."); alert(y[(y.length)-1]);</script>