title: How to show and hide DIV based on URL. in Javascript
body: <p>I have two URL's</p>
  
  <pre><code>url 1 = www.xyz.co.uk/asd.qmd
  url 2 = www.xyz.co.uk/asd.qmd?getstep=4#
  </code></pre>
  
  <p>I want to show a div(left)  when  PAGE URL is <strong>www.xyz.co.uk/asd.qmd?getstep=4#</strong></p>
  
  <p>In the page form.php I wrote the following code:</p>
  
  <pre><code>&lt;script&gt;
      $(function(){
          var locate = window.location;
  
          if (locate=="http://localhost/school/form.php") {
              $('#left').hide();
          } else {
              $('#left').show();
          }
      });
  &lt;/script&gt;
  
  &lt;body  onload="function()"&gt;
      &lt;div id="left"&gt;
          aasdsasdfdsgfg
      &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>Why is this not working?</p>