Make link iframe to app

Hi. I have added an iframe to a F7 page. I want to open a page in app when a user click button in the iframe. I tried foloowing code but it dosen’t work. How can I do?

<a href="/rayon/" target="_parent" class="btn btn-primary" id="btnClose" style="background-color: #ff6600; width:100%">Main Page</a>

This code is in the iframe.

iframe doesn’t really know about F7
try this:

<a onclick="'/rayon/')">Main Page</a>

that is the easy way
which i personally don’t really like

Any need to set target?

Sounds like a not good idea. Why do you this? If iframe has a different origin I don’t believe it is easily possible

Because I realized payment process in an iframe. when the payment process finish, a result message and an “OK” button appears in the iframe. If user clicks OK button, I want open app’s home page without iframe.

vladimir was pretty clear
that is a SS job

if you insist (hope you dont)
go to
open console and type this:

var url='';
var iframe=Dom7('<iframe src="'+url+'" width="400" height="400"></iframe>');

now, wait for iframe to be load
and type this:

var code="'/about/')";

now click on your iframe and the “parent” will load “about” page

I tried this solution but I have an error when clik the button.

Uncaught DOMException: Blocked a frame with origin “null” from accessing a cross-origin frame.

my code works only on same-origin

yours is definitely a diff-origin
you can’t do that