title: js function to get filename from url
body: <p>I have a url like <a href="http://www.example.com/blah/th.html" rel="noreferrer">http://www.example.com/blah/th.html</a></p>
  
  <p>I need a javascript function to give me the 'th' value from that.</p>
  
  <p>All my urls have the same format (2 letter filenames, with .html extension).</p>
  
  <p>I want it to be a safe function, so if someone passes in an empty url it doesn't break.</p>
  
  <p>I know how to check for length, but I should be checking for null to right?</p>