title: How to extract a GET parameter from the URL in Javascript?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/827368/use-the-get-parameter-of-the-url-in-javascript">Use the get parameter of the url in javascript</a>  </p>
  </blockquote>
  
  
  
  <p>Suppose I have this url:</p>
  
  <pre><code>s = 'http://mydomain.com/?q=microsoft&amp;p=next'
  </code></pre>
  
  <p>In this case, how do I extract "microsoft" from the string?
  I know that in python, it would be:</p>
  
  <pre><code>new_s = s[s.find('?q=')+len('?q='):s.find('&amp;',s.find('?q='))]
  </code></pre>