title: How can I tell if a user is on index.html?
body: <p>I use document.URL to detect if a user is on index.html:</p>
  
  <pre><code>if(document.URL.indexOf("index") &gt;-1) return true;
  </code></pre>
  
  <p>But if the user types "mydomain.com" or "mydomain.com/" then the test returns false.</p>
  
  <p>I could try:</p>
  
  <pre><code>if(document.URL ==="http://myDomain.com") return true;
  </code></pre>
  
  <p>But I want to use this code on different domains. Any suggestions?</p>