A
A
asilent2021-12-18 17:53:14
JavaScript
asilent, 2021-12-18 17:53:14

How to force the iframe to update instead of the parent window?

Hello!

I have a Stripe payment form, it is displayed in an iframe that opens in a modal.

After successful payment - stripe will redirect to the successful payment page (the one I specify). But for some reason, it does not redirect the iframe in which it is located, but the parent window.

Both the iframe and the parent window are the same site.

How can I redirect the frame instead of redirecting the parent window? Something can be written inside the iframe itself to change the logic at the level of js events.

do not offer sandbox, I already tried it, there are no parameters that would fit this logic. A redirect cannot be prohibited, it is needed, but inside the iframe and not outside.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nadim Zakirov, 2021-12-18
@zkrvndm

In theory, if you change the source in the parent window, then the frame will lose control over it. Remind yourself tomorrow, I'll show you an example, now I'm not at the computer anymore.

S
sasmoney, 2021-12-21
@sasmoney

https://snipp.ru/jquery/reload-iframe

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question