SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2007
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Break out of Frames - WITHOUT Javascript!

    Hi,

    This is a question about how to do something WITHOUT Javascript but I guess this is still the best forum to ask.

    There are tons of examples how to break out of frames with Javascript and I thought you couldn't do it without Javascript.

    But YAHOO! does it! If you place www.yahoo.com inside an iframe and click on an item in the Navigation (say Autos) it breaks out of the frame even if Javascript is disabled in the browser. Works for both IE and Firefox.

    The page redirects with a Location header a couple of times, but I tested that and it's not what is causing it to break out.

    To test simply create an html file on your desktop with the following contents:

    Code:
    <html>
     <body>
      <h1>My Iframe</h1>
      <iframe src="http://www.yahoo.com"></iframe>
     </body>
    </html>
    Disable Javascript in your browser, open this page and click on any of the links inside, they break of the iframe.

    Anyone knows or can figure out how they do it?


    Thanks guys
    -j

  2. #2
    SitePoint Enthusiast
    Join Date
    Jan 2007
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, I guess it can be done by having the links in the page inside the iframe do <a href=".." target="_top">. But yahoo doesn't do that, it must be doing it some other way, though I guess that's as good a solution as any.

  3. #3
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,863
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by johnnyp View Post
    But YAHOO! does it! If you place www.yahoo.com inside an iframe and click on an item in the Navigation (say Autos) it breaks out of the frame even if Javascript is disabled in the browser. Works for both IE and Firefox.

    Anyone knows or can figure out how they do it?
    However they did whatever it is you claim they did their site just displays in the iframe in Firefox even wwith JavaScript enabled.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  4. #4
    Google Engineer polvero's Avatar
    Join Date
    Oct 2003
    Location
    Mountain View
    Posts
    567
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Even if you found out how they did this, what are you going to do with that knowledge?


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
  •