title: Display the last part of URL javascript?
body: <p>I need to display the last part of a URL using javascript!</p>
  
  <p>I am using this code but this will display the entire URL:</p>
  
  <pre><code>&lt;script language="javascript"&gt;
  
  document.writeln(document.location);
  var url = $(this).attr("href");
  var part = url.substring(url.lastIndexOf('/') + 1);
  
  &lt;/script&gt;
  </code></pre>
  
  <p>if the URL look like this: </p>
  
  <p>domain.com/something/file</p>
  
  <p>i need to only display the "file".</p>