there is a site example.com

iframe is embedded in it on othersite.com

in case of an error, the iframe gives the code:

<form id="return" action='example.com/error' target='_parent'></form> $(function(){$('#return').submit();}); 

The problem is that the redirect occurs on example.com, but it is necessary that the iframe itself be redirected to example.com/error

I tried to wrap in 2 iframe but so example.com began to open in a new window, which is also not true. Tried to give id, name ifram equal to "_parent", did not work.

Tell me what I'm doing wrong, how to solve the problem?

  • one
    apparently you need to remove target='_parent' if you don’t have access yourself, contact the developers othersite.com - Grundy
  • @Grundy your solution works, but do you know another solution? (as you suggested, there is no access to othersite, changed it manually by disabling js for testing) The most interesting thing is that before the "layout" opening "othersite" was on the othersite side, and the error code worked exactly as needed. Now, the "layout" moved to us, but failed to understand why the behavior has changed. (I expected that having embedded an iframe in an iframe, it would have the same structure as when the "layout" was on othersite) - noadev
  • @Grundy as a result I will write to othersite developers. Make your decision a response - noadev

1 answer 1

All because of target='_parent' , you need to remove it or replace it with target='_self' .

If you cannot replace yourself, contact othersiteite.com developers .