title: Using the GET parameter of a URL in JavaScript
body: <p>If I am on a page such as </p>
  
  <p><a href="http://somesite.com/somepage.php?param1=asdf" rel="noreferrer">http://somesite.com/somepage.php?param1=asdf</a></p>
  
  <p>In the JavaScript of that page, I would like to set a variable to the value of the parameter in the GET part of the URL.</p>
  
  <p>So in JavaScript:</p>
  
  <pre><code>&lt;script&gt;
     param1var = ...   // ... would be replaced with the code to get asdf from URI
  &lt;/script&gt;
  </code></pre>
  
  <p>What would "..." be?</p>