title: Can someone explain iFrames?
body: <p>My understanding of the iFrame is that the content inside is exactly what is included in the src. I've seen numerous widgets like Facebook etc that use an iFrame.</p>
  
  <p>When I try using an iFrame, I have an HTML file with only a div and some content inside, no head, body, etc. Just the content in HTML. But the iFrame always loads the entire page and ends up giving me a recursive iFrame within an iFrame. </p>
  
  <p>I don't see how this is since my HTML file that is referenced in the iFrame is just content and nothing else. I'm not including a header, footer but all that gets displayed anyway. </p>
  
  <p>I've seen where people are talking about scrolling the iFrame to a certain section and even using the div's id in the src and setting the scrolling=no. This works, but my iFrame content will reload based on user input and once it reloads it returns to the top-left portion of the page inside the iFrame.</p>
  
  <p>This doesn't make any sense. Maybe this is supposed to be a widget or something?</p>
  
  <p>Edit for SD to show some formatted code:
  @Surreal Dreams</p>
  
  <p>That's the strange thing. I'm using web2py so it might be something inherent in the backend that's causing that. The html file literally is a div wrapper with some elements inside. But I think the web2py is adding the header in there even though I'm not extending any kind of layout. I eventually did get it to work correctly by referencing the same html file saved offsite at another url. There it displayed properly without web2py interfering with the html structure.</p>
  
  <p>What was happening before, I had code like this:</p>
  
  <pre><code>{{extend 'layout.html'}}
  &lt;div class="wrapper"&gt;
  &lt;page content&gt;
  &lt;aside id="iFrame wrapper"&gt;
  &lt;iframe src="/rates.html"&gt;&lt;/iframe&gt;
  &lt;/aside&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And that's the basic structure of the web2py page where inside layout you have all your headers, footers, etc. Well what was happening is that it would generate the entire page, and where you get to the iFrame, it generates the page again inside that iFrame, and then on down to the iFrame again, which continues to infinity rendering the page inside each iFrame's page.</p>