title: How to pull the file name from a url using javascript/jquery?
body: <p>A certain variable might contain a relative path or an absolute path.  Either way, I need to be able to pull the filename from the variable:</p>
  
  <pre><code>http://www.somesite.com/dir1/dir2/filename.gif
  /dir1/dir2/filename.gif
  </code></pre>
  
  <p>The directory structure is also arbitrary.  So basically given either of the url's above (with arbirtrary directory structure) I need to pull 'filename.gif'.  Thanks in advance</p>