How to jump out of iframe after the success of iframe for WeChat Alipay payment development.

  java, question

Paying with Alipay in WeChat is blocked from url, I use iframe in jsp,< iframe id = "iframe1" src = "$ {redirecturl}" width = "100 percent;" Height="100 percent; " name="main" onload="load()"></iframe>
After the payment is successful, you cannot jump out of the iframe. how can you jump out of the iframe if the point continues to pay is equivalent to nesting another iframe?

Move the answer to the question area

After success, iframe page has a label a link< a href="/ "> return to home < /a >. However, after clicking this link, it is still in the iframe. I just want to prevent it from being in the iframe now. I use this method<a href="javascript:;" OnClick = "Window.parent.location.href ='/'"> Return to Home < /a >Still in iframe, do you have some code? Thank you very much, I can also monitor the url that jumps to this page, but how to operate after getting the url and how to jump out of this iframe? WeChat development has a little headache.

You can write a function for the last click event.

if(window !  = top) {
 Top.location.href = the page you want to jump to.
 bracket = "your redirect url";