How provide results based on the query results in a url?
<p>Is there a javascript solution to read the url,create a string from it, and build a if statement based on the results?  Does anyone know of a tutorial or can provide me with some tips of how to accomplish this.  </p>

<p>To be more specific I am trying to do this based on a search result.  So.. for example the url is something like:</p>

<p><a href="http://www.site.com/catalogsearch/result?q=asdf&amp;kw=asdf&amp;x=0&amp;y=0" rel="nofollow">http://www.site.com/catalogsearch/result?q=asdf&amp;kw=asdf&amp;x=0&amp;y=0</a></p>

<p>and working off of Daniels response I am trying this with no luck:</p>

<pre><code>if (window.location.search ==='?q=asdf') {
alert("You searched for asdf");
}
</code></pre>
