jQuery find file extension (from string)
- by SoulieBaby
Hi all, I was wondering if it was possible for jQuery to find a file extension based on a returned string?
A filename (string) will be passed to a function (openFile) and I wanted that function to do different things based on what file has been passed through, it could be image files or pdf files.
function openFile(file) {
//if .jpg/.gif/.png…