Solved

Break Out of IFRAME when URL changes

Posted on 2008-10-13
7
448 Views
Last Modified: 2012-05-05
I'm framing in a portion of anotherwebsite.com on mywebsite.com/page (urls are just for example), which looks just fine and gives me the desired result I'm looking for. However, when someone clicks on a link inside the IFRAME the content inside the IFRAME will change to something like anotherwebsite.com/contactus, but I will not want these other pages to be embedded inside the IFRAME. I would like to have the user broken out of the IFRAME somehow into a pop up window with the full URL or just have the browser load the new URL. Is there anyway to detect this URL change and break the user out of the IFRAME? The website embedded in the IFRAME is not mine, so I don't have control over the content or code behind the site. Thanks.
0
Comment
Question by:sivle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
7 Comments
 
LVL 13

Expert Comment

by:Brum07
ID: 22702912
0
 

Author Comment

by:sivle
ID: 22702978
Thanks, but that tells you how to prevent your site from being included inside an IFRAME. In other words, it is used to automatically break your own site out of an IFRAME that someone else is trying to include your site in. I'm embedding someone else's page inside of my IFRAME and want to break them out when the URL changes. Different scenario.
0
 
LVL 13

Expert Comment

by:Brum07
ID: 22703001
Sorry mis-read the question.
0
Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

 
LVL 82

Accepted Solution

by:
hielo earned 200 total points
ID: 22703418
For you to achieve what you seek, you need to do so from the page contained within the iframe. If you do not have access to the page within the iframe, then the browser will not let you do what you want since it is cross-site scripting, which the browser's do not allow for security reasons.
0
 

Author Comment

by:sivle
ID: 22704653
I think i've seen similar things done with Javascript...perhaps I need to move this question to that area for help. Thanks for the feedback.
0
 
LVL 82

Expert Comment

by:hielo
ID: 22704777
sivle, it seems to me your request was very clear, and my response is correct. Even though you posted this under Scripting languages, you will still get the same answer if you post this under Javascript, after all, javascript IS also a scripting language. The "solution" you seek is NOT dependent on any scripting language. The "solution" depends on whether or NOT you have control over the page within the iframe. Javascript or not, the limitation to what you seek is the security restriction imposed by the browser, not the scripting language you use.

http://www.experts-exchange.com/help.jsp#hi405
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question