title: Recieve data into javascript from entered url to webpage
body: <p>I have a webpage that alerts me the with the current .href of the website. However I want to be able to pass a short variable into the webpage when entering the domain name so that I later can use that in js.</p>
  
  <p>For example going to website localhost entering: <em>localhost/HelloWorld</em> <strong>should alert</strong> "<em>HelloWorld</em>"</p>
  
  <p>Is this possible?</p>
  
  <p>This is my html code:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;title&gt;Get Current URL in JavaScript&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;script&gt;
      function getURL() {
          alert("The URL of this page is: " + window.location.href);
      }
      &lt;/script&gt;
  
      &lt;button type="button" onclick="getURL();"&gt;Get Page URL&lt;/button&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>