JavaScript, iFrames and Browser History Problem

Discussion in 'JavaScript' started by johannisson, Oct 29, 2007.

  1. #1
    Hi.

    I have a problem with browser history when I use a javascript to update multiple iFrames.
    The java script is like this:


    function onLoadFrames(page1,page2)
    {
    content1.location.href=page1;
    content2.location.href=page2;
    }


    This update two iFrames (content1 and content2). The problem is that each load creates a history entry in the browser history. This result in that the user have to click two times on the back button to go 'one' step back. This is because the iFrames are updated separately.

    Is there a way to update the two frames without creating two history entries or is there a way to remove the extra history entry.
     
    johannisson, Oct 29, 2007 IP
  2. ezpz

    ezpz Peon

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I was hoping someone would answer this because I have the same problem...

    However, something has struck me - when you update images using javascript, you don't run into this problem. So if you can render your content as images rather than iFrames, you can do it like that.

    What would be really neat would be if there was a server side script that could take some html and a window size, and render it as an image - this would have all of the advantages of being called like an iFrame, but without the browser history problems. But I don't know if such a script exists anywhere...
     
    ezpz, Nov 10, 2007 IP