Can I hide a div based on whether the URL contains a string such as "page="
<p>I am working with a SAAS CMS and there is no variable for me to grab if I am on a section landing page or a paginated page. I need to be able to hide a <code>div</code> if I am on a page that contains <code>"?page="</code> in the URL. Is there any successful way to do this with jQuery? I have tried several solutions offered up on SO, but none of the solutions I have tried works for my situation.</p>

<p>Just adding another note here. URLs out of the CMS that need to be targeted are looking like this <code>foo?page=</code> or <code>bar?page=</code> so I am just trying to detect the <code>?page=</code> portion and hide the <code>div</code> if that is present. Thanks!</p>

<p>Have tried:</p>

<pre><code>$(document).ready( function() {
if (/\/?page=\//.test(window.location)) {
    $('#collection-description').hide();
    }
 });
</code></pre>

<p>and</p>

<pre><code>$(document).ready( function() {
       if ($('a[href*=page']).size() &gt; 0) {
      $('#collection-description').hide(); 
   }
});
</code></pre>

<p>Any other directions to try would be awesome. Thanks!</p>
