admin管理员组文章数量:1022964
I have a JS game that's running inside an IFRAME, which is scaleable and all that fancy stuff.
The game contains a link to the next page, and the link works brilliantly.
Problems is that the link is opening inside the IFRAME and not the parent window. I need the flow to continue in the parent window and not the iframe.
the way the next page is linked in the IFRAME is like this:
LINK_BUTTON="data.php",
That's the only piece of code pointing out the link. To my regret I can't FIDDLE this because of disclosure issues.
Can anyone help me out?
I have a JS game that's running inside an IFRAME, which is scaleable and all that fancy stuff.
The game contains a link to the next page, and the link works brilliantly.
Problems is that the link is opening inside the IFRAME and not the parent window. I need the flow to continue in the parent window and not the iframe.
the way the next page is linked in the IFRAME is like this:
LINK_BUTTON="data.php",
That's the only piece of code pointing out the link. To my regret I can't FIDDLE this because of disclosure issues.
Can anyone help me out?
Share Improve this question edited May 28, 2015 at 10:41 Aurelio 25.9k9 gold badges61 silver badges64 bronze badges asked May 28, 2015 at 10:37 TjoerieTjoerie 251 silver badge9 bronze badges 2- Is LINK_BUTTON a javascript variable? – aldux Commented May 28, 2015 at 10:39
- Yes it is. It's the first line next to the "var". – Tjoerie Commented May 28, 2015 at 10:39
4 Answers
Reset to default 2Use target="_parent"
on your link.
<a target="_parent" href="data.php">link</a>
Or from Javascript
window.top.open("data.php");
Use the target attribute. This will force the link to open in the parent.
<a target="_parent" href="data.php">Next</a>
You can just set the target attribute. To open in the current top window (top frame):
<a href="http://example." target="_top">Link Text</a>
Or to open in a new window:
<a href="http://example." target="_blank">Link Text</a>
There's also _parent for the parent window (not necessarily the top) and _self for the current window (the default).
The short answer, as given above, is really to add target="_parent"
attribute to your anchor (link).
The catch here is that you'll have to find in the javascript code where the LINK_BUTTON is used to generate the rendered link, and then in the code, add the target attribute.
I have a JS game that's running inside an IFRAME, which is scaleable and all that fancy stuff.
The game contains a link to the next page, and the link works brilliantly.
Problems is that the link is opening inside the IFRAME and not the parent window. I need the flow to continue in the parent window and not the iframe.
the way the next page is linked in the IFRAME is like this:
LINK_BUTTON="data.php",
That's the only piece of code pointing out the link. To my regret I can't FIDDLE this because of disclosure issues.
Can anyone help me out?
I have a JS game that's running inside an IFRAME, which is scaleable and all that fancy stuff.
The game contains a link to the next page, and the link works brilliantly.
Problems is that the link is opening inside the IFRAME and not the parent window. I need the flow to continue in the parent window and not the iframe.
the way the next page is linked in the IFRAME is like this:
LINK_BUTTON="data.php",
That's the only piece of code pointing out the link. To my regret I can't FIDDLE this because of disclosure issues.
Can anyone help me out?
Share Improve this question edited May 28, 2015 at 10:41 Aurelio 25.9k9 gold badges61 silver badges64 bronze badges asked May 28, 2015 at 10:37 TjoerieTjoerie 251 silver badge9 bronze badges 2- Is LINK_BUTTON a javascript variable? – aldux Commented May 28, 2015 at 10:39
- Yes it is. It's the first line next to the "var". – Tjoerie Commented May 28, 2015 at 10:39
4 Answers
Reset to default 2Use target="_parent"
on your link.
<a target="_parent" href="data.php">link</a>
Or from Javascript
window.top.open("data.php");
Use the target attribute. This will force the link to open in the parent.
<a target="_parent" href="data.php">Next</a>
You can just set the target attribute. To open in the current top window (top frame):
<a href="http://example." target="_top">Link Text</a>
Or to open in a new window:
<a href="http://example." target="_blank">Link Text</a>
There's also _parent for the parent window (not necessarily the top) and _self for the current window (the default).
The short answer, as given above, is really to add target="_parent"
attribute to your anchor (link).
The catch here is that you'll have to find in the javascript code where the LINK_BUTTON is used to generate the rendered link, and then in the code, add the target attribute.
本文标签: javascriptHow to make a link placed inside an IFRAME open in the parent windowStack Overflow
版权声明:本文标题:javascript - How to make a link placed inside an IFRAME open in the parent window - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745595452a2158139.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论