Let’s says I have :
<img src='static/images/banner/blue.jpg' />
Using jQuery, how could I get the blue data ?
If I use $('img').attr('src'), I can get the whole URI. In that case, what is the best way to remove the extension and all the path ?
There are a couple gotcha here- local files may use the other slash (‘\’) in the pathname, and some filenames can have hash or search tails defined, or not have an extension.