简体   繁体   中英

iFrame link to load in Parent page without specific href alteration

UPDATED:

Is there any javascript I can include that results in any link selected within an iFrame to load in the parent page on SharePoint 2007? I am using a content editor web part.

This is the code I am currently using. I have my iFrame displaying a specific section of the target page. I got this code from http://www.webdeveloper.com/forum/showthread.php?t=108520

    <style type="text/css">
    <!--
    #container{
        width:700px;
        height:300px;
        border:1px solid #000; 
        overflow:hidden;
        margin:auto;
    }
    #container iframe {
        width:720px;
        height:605px;
        margin-left:-20px;
        margin-top:-305px;   
        border:0 solid;
    }        
    -->
    </style>

    </head>
    <body>


    <div id="container">
    <iframe src="my URL" scrolling="no"></iframe>
    </div>


    </body>
    </html>

I have replaced my actual URL with "my URL".

Any suggestions would be great.

Thanks in advance, Karl

you don't need javascript to change the target of a link on html 4 transitional or html 5, that's what the target attribute is for

if you want the link to replace the parent page completely, simply set the target attribute of the <a> to target="_top"

special values for the target attribute - html recomendation

if you want to change the content of another iframe in the parent page, you set the target value to the name attribute of the other frame

changing frame content - html recomendation

you can also set the target attribute on a form element

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM