title: How to tell if current frame is parent?
body: <p>I'm working in a framed environment, and trying to tell if the frame on which some javascript code executes is the top frame (the one that contains the rest).</p>
  
  <p>Up until now I was trying to check it with</p>
  
  <pre><code>window.parent != null
  </code></pre>
  
  <p>but it always returns false, like in this simple example.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
    &lt;script&gt;
      alert(parent == null);
    &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;h1&gt;OH YEAH!&lt;/h1&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Is there a way to do this? I doesn't have to be portable, right now I'm looking for the IE6 solution.</p>