title: using if-else by checking page URL
body: <p>How can I write a function to conditionally run <code>document.write</code> depending on the current URL?</p>
  
  <pre><code>&lt;script language="JavaScript"&gt;
  &lt;!--
  function urlCheck() {
  if(
  window.location.href=="address to check"
  )
  {
  /* some code to load */
  }else{
  document.write('&lt;div&gt;testing my super loaded div code sample&lt;/div&gt;')
  }
  }
  urlCheck() /* autoLoadFunction */
  //--&gt;
  &lt;/script&gt;
  </code></pre>