Hide button conditionnaly using javascript and css
<p>I need to display conditionnaly my shopping cart button using Javascript and Css. My goal is to hide the button when no items are present inside the cart.</p>

<p>The code of my button is:</p>

<pre><code>&lt;span id="mycartbutton" style="float: right; clear: both;"&gt;
&lt;a class="button"href="$(shopping_cart_url)"&gt;Mon panier&lt;/a&gt;
&lt;/span&gt;
</code></pre>

<p>When nothing is present in the cart, the url look simply like this:</p>

<pre><code>/.../mode=show_cart
</code></pre>

<p>When one or more items are present, the url look like this:</p>

<pre><code>/.../mode=show_cart&amp;cart_id=10332&amp;first_reservation_id=717
</code></pre>

<p>Unfortunately I'm not a coder and I don't have any knwoledges of javascript but I suppose is possible to make a check according to rendered url.</p>

<p>Actually I use the follow javascript:</p>

<pre><code>&lt;script type='text/javascript'&gt;
function on_site_form_loaded(event) {
    if (event=='product_list')
        document.getElementById('mycartbutton').style.display='none';
    }
&lt;/script&gt;
</code></pre>

<p>..this allow me to hide the button on product list as desired BUT even if some items are inside the cart.</p>

<p>Somebody can tell me which conditional code I must use for check if the url contain for example the text "cart_id"? This will mean something is present inside the cart and will let me hide the button.</p>

<p>thank for your time.</p>
