Hello All,

I seem to have come across a problem for which I don't a good solution. I receive incoming traffic from a site that does things with Framesets :-( and I would like to escape from that frame when the traffic gets to my site. They have it setup in such a way that there is usually nothing visible (of their page/site) in the browser window, but the URL is still the one pointing to their domain. This hides the users true location and makes it hard for users to bookmark pages on MY site.

I've come up with a few ideas, but they each have problems.

  • The one that I thought would be simplest was to include some javascript on my site that forces the user out of the Frame
    // Jump out of iframe - start
    if (top != self) top.location.href = self.location.href;
    // Jump out of iframe - end
    

    This works (assuming the user has javascript active), but has a delay. So frequently my entire page gets displayed in the frame and then jumps out to take over the window. It works but doesn't look good. I looked at my page and see my JS included but it is rather far down the line. Is there a way to make my JS file one of the first included so it can do its processing prior to the page being loaded? I could modify the HTML.tpl file but I would really rather not.

  • The next idea was to create a router in PHP and modify the header to add the target="_top" option. But from a lot of digging, it seems plenty of people have that idea,but say it can't be done since PHP isn't in control at the needed time, and target="_top" can't be passed as a parm in the header.
  • My last idea would definitely work, but would be even uglier than my first one. Make an intermediate page with a link to the site that contained the needed target="_top" option. But that adds in a whole extra page and an extra click which I don't like

So any ideas of how I can solve the impact of this problem? Either how to get my javascript to process sooner, anything else that gets me the correct end result. The update of course has to be to something I can control, so adding target="_top" to the link on the other site is probably not going to happen :-(

Any ideas/suggestions appreciated.