Getting just the filename from a path with Javascript
- by DCD
I have a full path to an image, which I am using jquery to read, in the form $('img.my_image').attr('src') however I just want the filename portion (discarding the path).
Are there any built-in functions to do this, or would a regex be the only option?