title: how to get the parameter value from the url in javascript?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/523266/how-can-i-get-a-specific-parameter-from-location-search">How can I get a specific parameter from location.search?</a>  </p>
  </blockquote>
  
  
  
  <p>I have a url like the following.</p>
  
  <pre><code>http://localhost/xxx.php?tPath=&amp;pid=37
  </code></pre>
  
  <p>I want to get the pid=37 but by its name because on time the url is like above and then when page refreshed then the url becomes like the following.</p>
  
  <pre><code>http://localhost/xxx.php?tPath=&amp;action=xxx&amp;pid=37&amp;value=13&amp;fname=aaaa&amp;fone=4321122
  </code></pre>
  
  <p>So I want to get the pid=37. It might be a function to which I pass the pid as a parameter and it returns its value.</p>
  
  <p>How will I do this?</p>