title: jQuery add class based on page URL
body: <p>I have what I <em>think</em> is a simple question but I can't get it to work for the life of me.</p>
  
  <p>All I want to do is add some javascript to the page that adds a class to the main page container based on the URL.</p>
  
  <p>Let's say I have a site at root.com and the following html structure (loosely speaking):</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;div id="main" class="wrapper"&gt;
        Blah, blah, blah
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>What I want to do is a script that, if the page = (for example) root.com/technology, it adds a class to the main div. So the div would now look like:</p>
  
  <pre><code>     &lt;div id="main" class="wrapper tech"&gt;
  </code></pre>
  
  <p>I've loaded jquery, so I'd like to do it that way.</p>