How to switch on the link used in an iframe on another website?

Developed a small 1-page simple website("module") on HTML, CSS, JS. Without PHP and databases. Contains links to other resources.
Customers want to connect in the system the module through an iframe.

Insert the iframe tag in the system:
style="
width:100%;
margin: 0 auto;
height: 100vh;">


The module itself podruzhilsya well, works. But as soon as click on buttons that lead to other sources out.

Solutions:
1) tried to use the attribute sandbox="allow-top-navigation" written "Allows you to open links in the parent frame's document",
The result: when you use this attribute, in General, all flies...
2) I tried to use the seamless attribute, it is written that "links in frame not displayed inside of a frame in the current document;"
The result: nothing, same blocks....

Please tell me what other solutions are there ? Or are we not correctly used iframe and its attributes ?
April 3rd 20 at 18:33
1 answer
April 3rd 20 at 18:35
Solution
As I understand it, the main browser window has <iframe src="..."></iframe>, and when clicking inside it, they should open "out" (in the main browser window). If so, then you need the links to add target="_top" or target="_parent".
Thank you. This option came up!

Is it possible to make the links open in the current iframe without navigating to a new page ?
Did as in the documentation:

1) in an iframe wrote a name="calculator-iframe"
"iframe src="https://..calculator.html" name="calculator-iframe">

2) in the file calculator.html a reference to another resource wrote the attribute target="calculator-iframe"


The result again comes out error "the site on who is trying to pass does not establish the connection".
Why is this happening ? Not use properly attributes ? - eldred commented on April 3rd 20 at 18:38
name in iframe is required in order to from the parent window to switch pages. That is, if there is
<a href="dir/file-2.html" target="my-iframe">Link</a>
<iframe src="dir/file-1.html" name="my-iframe"></iframe>
then the link will be updated only the contents of the iframe. Moreover, if the iframe needs to do navigation, you will need to use relative paths relative to the file shown in the iframe. Links inside iframe does not need parameter target (Still have target="_self", but the links will work exactly the same). - jessie commented on April 3rd 20 at 18:41
@jessie, okay, thank you very much! - eldred commented on April 3rd 20 at 18:44

Find more questions by tags JavaScriptHTMLiframeWeb Development