title: window.location.indexOf not working in Javascript
body: <p>Below is what I have.</p>
  
  <pre><code>var myString = "http://localhost:8888/www.smart-kw.com/";
  alert(myString.indexOf("localhost"));
  </code></pre>
  
  <p>This give me alert... however if I change <code>var myString = "http://localhost:8888/www.smart-kw.com/";</code> to <code>var myString = window.location;</code>, it won't work (I don't get alert).</p>
  
  <pre><code>var myString = window.location;
  alert(myString.indexOf("localhost"));
  </code></pre>