Add class to <body> if url has /shop/
<p>I'm working on a SquareSpace shop and unfortunately for me, no class gets added to the body for all shop pages. By this I mean any page that starts with <code>http://example.com/shop/</code></p>

<p>I would like to add a class to the body for all pages that start with this url whether it be <code>http://example.com/shop/item1</code>, <code>http://example.com/shop/category/category-name</code>, etc.</p>

<p>I tried this, but no class gets added to the <code>&lt;body&gt;</code>.</p>

<pre><code>$(document).ready(function() {
    if(url.indexOf('/shop/') &gt; -1){
        $("body").addClass("shop");
    }
});
</code></pre>

<p>How can I make this work?</p>