?
Solved

Break Out of IFRAME when URL changes

Posted on 2008-10-13
7
Medium Priority
?
450 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
Interactive Way of Training for the AWS CSA Exam

An interactive way of learning that will help you visualize core concepts so that you can be more effective when taking your AWS certification exam.  Built for students by a student to help them understand the concepts that they are being taught.

 
LVL 82

Accepted Solution

by:
hielo earned 800 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

This article will show, step by step, how to integrate R code into a R Sweave document
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

762 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