none
Multiple iframes on a page, refresh problem

    Question

  •  

    I have a page with several iframes on it.  Everything is fine when we come to the page but if we hit refresh on the toolbar, they all end up with the same src.  Even though when I view source the three frames have a different src, they reoad with the src of the first iframe on the page.

    Monday, February 11, 2008 10:16 PM

All replies

  • Is there somthing I can do to get these frames to load with the correct src?  I tried giving them a name attribute but that did not help.

     

    Friday, February 15, 2008 12:55 PM
  • this shouldn't happen.

    any chance you can post a url so we can investigate?

    also, what logic loads the content of the frames? Javascript? or is it set by the server?
    Friday, February 15, 2008 1:44 PM
  • Instead of Name attribute, use the ID attribute and give unique names for each of the IFrame.

     

    Tuesday, February 19, 2008 4:34 AM
  • I noticed somethign about this problem.  It seems to have something to do with the combination of iframes, tables, and the page fully loading. 

     

    The page has a table with two columns for content.  In each column are tables containing the iframes.  Each iframe is a page that is a report.  The iframes in the right column are always reload incorrectly or blank out.  The iframes on the left are always ok.

     

    The problem got worse when I added a report to the right column that takes a while to come back >3 secs.  When it finally comes back the iframe above reloads blank (the report appears then disappears.

     

    Is there a better way to do this besides iframes inside tables?

    Tuesday, March 04, 2008 1:05 PM
  • OK,  it is not the tables/iframes it is the timing of the page loading and iframes loading that seems to be the problem. 

     

    This is a big page.  I think if some iframes finish loading before the top page finishes loading and other iframes are still loading I end up with blank iframes.

     

    I set the iframe src="" and set timers to change the iframe location and things work.  It is a pain to maintain and feels like a hack.

     

    scTimerID =  window.setTimeout("showSalesChart()", 800);

     

    function showSalesChart(){
        frames['salesChartFrame'].location.href = 'http://rgweb.rathgibson.com/reportportal/Proxy.aspx?reportId=22'
    }


     

    Not sure what else I can do but if anyone has a suggestion I would be happy to hear it.

     

    Thanks

    Tuesday, March 04, 2008 8:04 PM
  • I also have the exact problem.  i have several iframes on a page.  works fine when i load but on refresh the iframe thats to the right most of the page loads a different iframe from the middle of the page.  I used  a different id for each frame and a different url.  The iframe to the left and rightmost of the page have the same url but different id tags.  works in firefox fine.  the url of my site is 'bustnutt.com' (adult)
    Friday, March 28, 2008 10:49 PM
  • I faced this problem with a simple  webpage:

    <html>
    <body>

    <IFRAME id="first" SRC="http://www.google.com" WIDTH=450 HEIGHT=100>
    </IFRAME>
    <iframe id="second" src="http://www.yahoo.com"  WIDTH=450 HEIGHT=100>
    </iframe>

    </body>
    </html>

    it loads ok with IE6. I hit refresh, then the second iframe loads up the google page. I end up with two iframes pointing to google.

    It turn out a software i had installed a while back had a BHO component that was causing this issue.. I uninstalled it, and it works fine now.

    Friday, May 08, 2009 2:02 PM