Break out of an Iframe

Experts,

I have  a website on which I have an Iframe. A third party vendor loads in to my Iframe. My user will interact directly in the iframe , the user in puts are validated by the third party vendor only. Upon validaiton completion I need to break out of the iframe. Please suggest me an idea how I can accomplish it.

Thanks
SubbuUSAAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

onlyaymieCommented:
0
SubbuUSAAuthor Commented:
@onlyaymie

Thanks for your reply. However I need some more help.

Is there a way I can pass a URL as a parameter from the onload or onclick function call to my javascript breakoutiframe () to get redirected to the desired web page
<html>
<head>
<script type="text/javascript">

function breakout_of_frame(var paramurl1)
	{
          if paramurl1 contains cc
	    redirect to cc page';
          else
          redirect to main page
	  return true;
	}
}
</head>
<body >
Authentication successful Verified your Identity. <tri:Lnk SiteUrl="CreditCenter" target="_top">click Go to CC </tri:Link> to go to CC 
<br/>
<div style="text-align:center;padding-bottom: 20px;">
<tri:InputImg OnClick="javascript:breakout_of_frame([b]paramurl1[/b]);" class="finished" name="SaveChanges"  src="CC /buttons/btn-gotoCC .gif" alt="Go To CC " DisableOnSubmit="true"/></td>

</body>
</html>

Open in new window

0
onlyaymieCommented:
Is your html page that has the javascript an ASP (or other server side programming) page or just a static html page?
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

SubbuUSAAuthor Commented:
@ onlyaymie

No it will be a content file that I need to redirect..which takes control and renders the appropriate *.aspx page. Before redirecting I need to break out of the javascript .


<html>
<head>
<script type="text/javascript">
function copyText(url, f1,f2)
{
document.getElementById("field2").value=document.getElementById("field1").value;
alert(url);
//Break out and rediret to credit.aspx

}
</script>
</head>
<body>

Field1: <input type="text" id="field1" value="Hello World!" /><br />
Field2: <input type="text" id="field2" />
<br /><br />
<button onclick="copyText('credit.aspx','hi1','hi2');">Pass values1</button>

</body>
</html>
0
SubbuUSAAuthor Commented:
Or the function copytext() needs to be called from body onload()...either way I am fine. I would prefer body onload.

anyhelp on this would be greatly appreciated
0
onlyaymieCommented:
I think this does what you are asking for...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<script>


(function(window) {
  if (window.location !== window.top.location) {
    window.top.location = window.location;
  }
	window.location = "http://google.com";
})(this);

</script>
<title>Untitled</title>
</head>
<body>

</body>
</html>

Open in new window

0
SubbuUSAAuthor Commented:
@onlyaymie

thanks for your response. As a band aid I was able achieve my functionality like the code below. However I need to take decisions to which page it should go based on the query string  parameters in go_now() function like u. Please let me know your thoughts.

<HTML>
<HEAD>
<TITLE>Automatic Redirection to Credit Center</TITLE>
<script type="text/javascript">

function redirect () 
{ 
setTimeout("go_now()",100); 
}
function go_now ()   
{ 
top.location = "http://www.google.com"; 
or 
top.location ="www.yahoo.com"; // need to achieve this functionality based on decision statements
}

</script>
</HEAD>

<body onload="redirect()">

</body>
</HTML>

Open in new window

0
onlyaymieCommented:
something like this?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<script>
(function(window) {
      
  if (window.location !== window.top.location) {
    window.top.location = window.location;
  }
      alert(window.location.search.indexOf('blah=blah'));
      alert(window.location.search);
      if (window.location.search.indexOf('blah=blah')>-1) {
            window.top.location = "http://google.com";
      } else {
            window.top.location = "http://yahoo.com";
      }
})(this);

</script>
<title>Untitled</title>
</head>
<body>

</body>
</html>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SubbuUSAAuthor Commented:
Thanks appreciated
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.