120 users online (0 members and 120 guests)  


  Results 1 to 2 of 2

Related

  1. Calling PHP on HTML page with Iframe    Forum: HTML Forum
    Replies: 5
  2. Passing value from iframe to parent    Forum: Javascript Forum
    Replies: 0
  3. Passing value from parent window to child window    Forum: Javascript Forum
    Replies: 0
  4. Replies: 1
  1. #1
    carbon's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2010
    Posts
    1

    Show page from iFrame url in parent window

    Is it possible with HTML to cause a link that is served up in an iFrame to replace the content in the original parent window of the browser?
    I have tried the _top, _parent, and _blank. They all seem to load the new page into the iframe that the url was served up in.


    Or would this be better accomplished via JavaScript

  2. #2
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    733

    Re: Show page from iFrame url in parent window

    Hi there carbon,

    and a warm welcome to these forums.

    Try it like this...

    iframe-page.html
    Code:
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
     "http://www.w3.org/TR/html4/loose.dtd">
    <html lang="en">
    <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta name="language" content="english"> 
    <meta http-equiv="Content-Style-Type" content="text/css">
    
    <title></title>
    
    <style type="text/css">
    body {
        background-color:#999;
        color:#000;
     }
    #ifr_container {
        width:324px;
        height:200px;
        border:1px solid #000;
        margin:auto;
        background-color:#fff;
     }
    #ifr_container iframe {
        width:100%;
        height:100%;
        border:0;
     }
    </style>
    
    </head>
    <body>
    
    <div id="ifr_container">
    <iframe src="page.html" frameborder="0"></iframe>
    </div>
    
    </body>
    </html>
    
    page.html
    Code:
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
     "http://www.w3.org/TR/html4/loose.dtd">
    <html lang="en">
    <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta name="language" content="english"> 
    <meta http-equiv="Content-Style-Type" content="text/css">
    <title></title>
    
    <style type="text/css">
    body {
        padding:0;
        margin:0;
        line-height:200px;
        text-align:center;
     }
    a {
        color:#000;
     }
    a:hover{
        color:#600;
     }
    </style>
    
    </head>
    <body>
    
    <div>
    <a href="http://www.ahfb2000.com/webmaster_help_desk/showthread.php?t=11963" target="blank">ahfb2000.com</a>
    </div>
    
    </body>
    </html>
    



Tags for this Thread