i have a url that will be consistent in this format:
http://www.name.com/heart/game/2012/topics/SOMETHINGHERE.html
I need to grab the ‘SOMETHINGHERE’ after topics/ and use that as a variable. I can get the current url:
var currentUrl = $(location).attr('href');
but not sure how to target and get just “SOMETHINGHERE” part?
Split the url into parts based on the slashes and then remove the .html from the end of the last part of the url: