Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Discard target="_top" for external page in iframe

Status
Not open for further replies.

yodaa

Programmer
Jun 10, 2004
64
SE
Hi,

I wish to create a basic page using an iframe. The iframe will contain a login page for a system we have purchased and can't modify. When you hit the login button, the welcome page will load on top of the page because since the target is set to top. The reason for why I wish to use an iframe is to be able to have a top "frame" (a toolbar) with a number of links to pages such as Quick help, FAQ, etc. I haven't found a way of forcing links in an iframe (outside of my control) to load link contents within the frame even if the target of the links are top, blank or whatever.

Is this possible at all? Any ideas of how you could solve this.

Thanks!

Ps. I re-posted this issue in this forum (was redirected here from my post in HTML). Sorry..

Regards,
yodaa
 
cLFlaVA,

There is a javascript in the head setting the target in the following way (PopNew is the ID of a check box)
Code:
	if( document.form1.PopNew.checked ) 
		document.form1.target = "NewWindow"; 
	else 
		document.form1.target = "_top";

The javascript also sets PopNew to true if the page isn't "top"
Code:
if( window == top )
document.form1.PopNew.checked = false;
else
document.form1.PopNew.checked = true;
 
actually, i don't think there's anything you can do. you can use javascript to manipulate pages within your domain, but if you're trying to manipulate pages within another domain, i think you're out of luck.



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
however, if it resides in the same domain, try something like this in your main page...

[tt]document.frames['YourIFrameName'].document.forms['form1'].target='';[/tt]

in your body's onload event.



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
cLFlaVA,

All files are on the same server. I want to replace the current index file with an index file containing the tool bar.

My new index page code
Code:
<html>
    <head>
        <title>UNITS tool bar test 3..</title>
        <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    </head>
    <body onLoad="document.frames['dtwindow'].document.forms['form1'].target='';">
	<div>APA</div>
        <div>
            <iframe id="dtwindow" src="../scripts/sysrun.dll" width="100%" height="100%" scrolling="auto" 

align="center" frameborder="0">
            </iframe>
        </div>
    </body>
</html>

The onLoad part didn't do the trick. Am I missing something here?

Thank you very much for your replies.

Regards,
yodaa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top