I have a url like http://www.example.com/blah/th.html
I need a javascript function to give me the \'th\' value from that.
All my urls have the same format (2
Using jQuery with the URL plugin:
var file = jQuery.url.attr("file"); var fileNoExt = file.replace(/\.(html|htm)$/, ""); // file == "th.html", fileNoExt = "th"