javascript - Break out of 1 frame from within a frame -


i writing code inside portal. have searched high , low 2 days no luck. portal writing code in, uses iframes, , top frame. when "app" clicked, portal, displays program. without telling long story, have use iframe. page displays iframe take credit card, , listens response of approved or declined. pass return url code in iframe. consequently, when transaction complete, redirected url passed....but in iframe on page. know can use this:

<script language="javascript" type="text/javascript">   function breakout_of_frame()   {     if (top.location != location)     {       top.location.href = document.location.href;     }   } </script> 

however code breaks out top frame, taking me out of portal. need break out of frame parent, , not top. have tried changing code using parent, , not work. have used target="_parent" , not work situation. (because i'm not submitting form, i'm sending return url) appreciated.

this answered here how access parent iframe javascript

long story short, use

parent.document.location 

hope useful!


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -