• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 219
  • Last Modified:

How do I break out from an IFRAME?

I have a normal HTML-page.
In that page I have the following
****************************************
<head>
<script language="JavaScript">
<!--
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
function load(page) {
      if (ns4) document.textLayer.src = page
      else if (ie4) parent.textFrame.document.location = page
}
//-->
</SCRIPT>
<STYLE>
#textDiv {position:absolute; left:180; top:100; width:400; height;200; clip:rect(0,400,200,0);}
</STYLE>
</head>

<body>
<DIV ID="textDiv">
<IFRAME SRC="test0.html" NAME="textFrame" SCROLLING="No" WIDTH="420" HEIGHT="500" MARGINWIDTH=0 MARGINHEIGHT=0 FRAMEBORDER="No"></IFRAME>
</DIV>

<DIV id="Layer1" style="position:absolute; left:5px; top:100px; width:150px; height:160px; z-index:1">
<A HREF="javascript:parent.load('newpage.html')">
Newpage</A>
</div>
</body>
*****************************************************
When I click on the link Newpage I display the newpage.html in the IFRAME.
THE PROBLEM:
When I am inside the IFRAME and click on a link I want a whole new window to open BUT the new link opens INSIDE the IFRAME.
I am stuck inside that IFRAME. How do I get out from it?
I tried with target=new but no success...

Can you help me?

 link to
0
Jennie2004
Asked:
Jennie2004
  • 6
  • 4
1 Solution
 
sajuksCommented:
in newpage.htnl place this between the head tags
<script language="Javascript">
<!--
if (top.location!= self.location) {
top.location = self.location.href
}
//-->
</script>
0
 
ZvonkoSystems architectCommented:
In the head of the newpage.html you need this:
<html>
<head>
<base target="_top">
</head>
<body>...

0
 
ZvonkoSystems architectCommented:
Sorry, you like a NEW window for every link.
Then use this:
<html>
<head>
<base target="_blank">
</head>
<body>...

And if you like ONE new window for all links, then give it a name:
<html>
<head>
<base target="ONE">
</head>
<body>...
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Jennie2004Author Commented:
The change I experience from both of your gentlemens' solution are similar.
Sajuks, with your script I the newpage.html opens ITSELF in a completely new window.
I want the newpage.html to stay in the IFRAME but when I click on a link INSIDE IFRAME I want the next page to open in a completely new and fresh window. I wasn't to clear in my question. I apologize.

<base target="_blank"> works when I click on a link in newpage.html

Therefor I thank both of you but have to give the points to Zvonko. No hard feelings Sajuks I hope...
0
 
ZvonkoSystems architectCommented:
But I have "hard" feelings :-)
Why did I got a grading B???
0
 
Jennie2004Author Commented:
The point system is quit new to me so maybe you are right and should have had an even higher grade. I thought that maybe I would be to generous if I sent a higher grade. The use of superlatives are generally overused in the everyday. I think it was a good solution. I will think more carefully in the future and will remember that I "owe" you one ;)
0
 
ZvonkoSystems architectCommented:
Ok, I can explain it to you ;-)
I do this stuff for free, so how would you pay my work to me except to say "Thank You".
Therefore you are not a Teacher telling me how good or bad my support was, but simply say Excelent! :)

But it is still not loast. You can correct your grading by posting a request for grading correction in this topic area:
http://www.experts-exchange.com/Community_Support/

Thanks in advance,
Zvonko

0
 
Jennie2004Author Commented:
Hi!
I could only find this when I was looking to change grade. Reading it I clearly can see that it was a A-grade answer you provided me with. You were right about the teacher metahphor.
I will continue to look for where I can ask the question to change the grade...

A: The Expert(s) either provided you with a thorough answer or they provided you with a link to information that thoroughly answered your question. An "A" can also be given to any answer that you found informative or enlightening beyond the direct question that you asked.

B: The Expert(s) provided an acceptable solution, or a link to an acceptable solution, that you were able to use, although you may have needed a bit more information to complete the task.

C: Because Experts' reliability are often judged by their grading records, many Experts would like the opportunity to clarify if you have questions about their solutions. If you have given the Expert(s) ample time to respond to your clarification posts and you have responded to each of their posts providing requested information; or if the answers, after clarification, lack finality or do not completely address the issue presented, then a "C" grade is an option. You also have the option here of just asking Community Support to delete the question.
Remember, the Expert helping you today is probably
0
 
ZvonkoSystems architectCommented:
Click on the folowing link and you are there:
http://www.experts-exchange.com/Community_Support/askQuestion.jsp
0
 
Jennie2004Author Commented:
Alright!
It is done! My apologies for the f*ck up. You will get the Excellent grade that you deserve. I can now also return to this topic to read the grade system. Thank you for letting me know :)
0
 
ZvonkoSystems architectCommented:
Not a problem at all.
It is only a part of the game ;-)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now