Help! Frame display problem!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brandon

    Help! Frame display problem!

    A newbie question for you all:

    Suppose you have a webpage with two frames: a main frame, and a second
    frame. You have several hyperlinks to other websites in the second
    frame. What you want is this: when someone clicks one of the
    hyperlinks in the second frame, the website that it points to will
    appear in the main frame.

    Well, for most hyperlinks, this is easy. You just include the string

    target="mainFra me"

    in the HTML of the second frame, as in:

    <A href="http://www.google.com/" target="mainFra me">Google</A>

    Now, for most websites, this works just fine. The website displays
    nicely in the main frame.

    BUT: for some websites, a NEW window is spawned which eliminates your
    two-frame structure.

    Is there an easy way to prevent this?

    Thanks in advance!

    Brett

    dbrett-phantasmagorica l
  • Richard Cornford

    #2
    Re: Help! Frame display problem!

    Brandon wrote:[color=blue]
    > Suppose you have a webpage with two frames: a main frame, and a second
    > frame. You have several hyperlinks to other websites in the second
    > frame. What you want is this: when someone clicks one of the
    > hyperlinks in the second frame, the website that it points to will
    > appear in the main frame.
    >
    > Well, for most hyperlinks, this is easy. You just include the string
    >
    > target="mainFra me"
    >
    > in the HTML of the second frame, as in:
    >
    > <A href="http://www.google.com/" target="mainFra me">Google</A>
    >
    > Now, for most websites, this works just fine. The website displays
    > nicely in the main frame.
    >
    > BUT: for some websites, a NEW window is spawned which eliminates your
    > two-frame structure.
    >
    > Is there an easy way to prevent this?[/color]

    No. If an ordinary link is loading a web page into a frame and then a
    new window is being opened (or the new page is re-loading itself into
    the topmost frame in place of your frameset) then it is code within the
    new page that is being loaded that is doing this. You cannot get at that
    code because of cross-domain security restrictions. So you cannot stop
    it from acting.

    Some people just don't want their web sites displayed in other people's
    framesets, and others insist on opening a new window for their site
    anyway.

    Richard.


    Comment

    Working...