title: Read javascript .js get parameters
body: <p>How can I read get parameters passed to a JS file like so:</p>
  
  <pre><code>&lt;script type="text/javascript" src="/script.js?p1=hello&amp;p2=world"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>In the same file (script.js) I want to read the p1 and p2 values like:</p>
  
  <pre><code>var p1 = params["p1"];
  </code></pre>
  
  <p>I'd rather avoid a method that getElementById's or uses the dom anyway. thanks.</p>