Detect URL with Javascript and apply CSS
<p>So I have a page I want to apply some CSS to, but it is dynamically generated by the CMS. The URL remains constant, so I thought I could stick this in the head of the template file to add the CSS to the page I want, but it's not working.</p>

<pre><code>&lt;script type="text/javascript"&gt;
jQuery(document).ready(function () {
if(window.location.href.indexOf("/products.html"))
{
document.write("&lt;style type=\"text/css\"&gt;
.category-grid li:nth-child(4)
{
margin-left:115px;
}   
&lt;/style&gt;");
}
});
&lt;/script&gt;
</code></pre>

<p>There's probably some syntax off on my <code>document.write</code> statement, as that's where the error seems to occur, but I can't figure it out. Any ideas?</p>
