title: Reading data from iframe to use the data for conditional judgements
body: <p>I am creating a page to upload images without refreshing the page using an iframe. What I want to do is upload the image with forms through an iframe and use the result for a conditional task. 
  I tried these methods:</p>
  
  <pre><code>&lt;iframe id="iframe" name="iframe"&gt;Inner code here, form and all inputs. &lt;/iframe&gt;
  &lt;script&gt;
  data=document.getElementById("iframe").innerHTML;
  &lt;/script&gt;
  </code></pre>
  
  <p>But this don't work as iframes work with source property only.
  Then i tried getting the body of iframe using window property.</p>
  
  <pre><code>data=window.frames['iframe'].document.body.innerHTML;
  </code></pre>
  
  <p>But this is also not working. Help. Thanks in advance.</p>