title: How to check a URL contains a string and handle the backslashes
body: <p>I am trying to to hide a div tag based on the contents of the URL.</p>
  
  <p>However, I want to search more than just "franky"</p>
  
  <p>If my URL is: <code>//MYWEBSITE/EN/HOME</code></p>
  
  <p>I want to check for: <code>/EN/HOME</code> not just home. However if I try this it just returns false.</p>
  
  <p>My theory is its the forward slashes but I am <code>java/jquery</code> newbie so I don't know. Maybe there is away to escape the / in the search terms.</p>
  
  <p>This code works if I use 'home</p>
  
  <p>Here is my code:      </p>
  
  <pre><code>if (homepathname.toLowerCase().indexOf('home') &gt;= 0) {
  
  &lt;script&gt;
  $(function(){
     var homepathname = window.location.pathname; 
    if (homepathname.toLowerCase().indexOf('/en/home') &gt;= 0) {
          $('#masterHomeBanner').show();
    } else {
          $('#masterHomeBanner').hide();
    }
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>Appreciate any help.</p>