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
精彩评论