Results 1 to 3 of 3

Thread: Keep Firefox from caching iframe

  1. #1
    Join Date
    Feb 2007
    Posts
    36
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Keep Firefox from caching iframe

    OK - realized I made this WAY more complicated than it needed to be.

    Here's the issue - how to keep firefox from caching what's in the iframe after it runs a resizing script - make it realize that a link has been clicked within the iframe, and then resize for that.

    main.htm has the iframe, which loads frame1.htm. frame1.htm has a link to frame2.htm which is a different size.

    I know there's a DD script - but I wondered if anything could be added to this particular script, to make it work in FF.

    This works in IE, but not FF - thanks!

    main.htm
    Code:
    <html>
    <head>
    <meta name="robots" content="noindex, nofollow"> 
    </head>
    <body>
    
    <div id="saysomething">hello world</div>
    
    <div><iframe id='library' src='frame1.htm' frameborder='1' height="300"></iframe></div>
    
    </body>
    </html>
    frame1.htm
    Code:
    <html>
    <head>
    <meta name="robots" content="noindex, nofollow"> 
    </head>
    
    <body onload="resizeIframe()">
    
    <script type="text/javascript">
    function resizeIframe() {
    var howtall = document.body.scrollHeight; 
    parent.document.getElementById('library').style.height=howtall; 
    parent.document.getElementById('saysomething').innerHTML=howtall; 
    }
    </script>
    
    <p>content frame1.htm - it's longer</p><p>content</p><p>content</p><p>content</p>
    <p> <a href="frame2.htm">go to frame2</a> <p>content</p>
    <p>content frame1.htm </p><p>content frame1.htm </p><p>content frame1.htm </p><p>content frame1.htm </p><p>content frame1.htm </p><p>content frame1.htm </p><p>content frame1.htm </p><p>content frame1.htm </p><p>content frame1.htm </p><p>content frame1.htm </p>
    <p>content frame1.htm </p><p>content frame1.htm </p><p>content frame1.htm </p><p>content frame1.htm </p><p>content frame1.htm </p><p>content frame1.htm </p><p>content frame1.htm </p><p>content frame1.htm </p><p>content frame1.htm </p><p>content frame1.htm </p>
    </body>
    </html>
    frame2.htm
    Code:
    <html>
    <head>
    <meta name="robots" content="noindex, nofollow"> 
    </head>
    
    <body onload="resizeIframe()">
    
    <script type="text/javascript">
    function resizeIframe() {
    var howtall = document.body.scrollHeight; 
    parent.document.getElementById('library').style.height=howtall; 
    parent.document.getElementById('saysomething').innerHTML=howtall; 
    }
    </script>
    
    <p>content frame2.htm  - its shorter</p><p>content frame2.htm</p><p>content frame2.htm</p><p>content frame2.htm</p>
    <p> <a href="frame1.htm">go to frame1</a> <p>conten frame2.htmt</p><p>content frame2.htm</p>
    
    </body>
    </html>
    Last edited by Peter Johnson; 09-22-2011 at 11:27 PM. Reason: Simplify question

  2. #2
    Join Date
    Mar 2007
    Location
    Dublin, Ireland
    Posts
    23
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    It seems that Firefox does some aggressive caching. I have some issues myself with a client's site. I'm not sure you can bypass it, but I'll watch this thread as someone might come up with an useful solution.

  3. #3
    Join Date
    Feb 2007
    Posts
    36
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Some attempts

    I tried
    I have tried math.random - didn't work with FF
    I also tried pragma no-cache in the framed pages - Didn't work with Firefox - it still just uses the height of the first page it loaded

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •