[英]Form Button in Iframe, When Clicked, Load in Parent Window
My page has an iFrame that loads products from an external javascript file. 我的页面上有一个iFrame,可以从外部javascript文件加载产品。 The products are not links, they are submit input buttons.
产品不是链接,它们是提交输入按钮。 Without knowing the url of the button, is it possible to load in the parent window instead of the iframe when clicked?
如果不知道按钮的网址,是否可以在单击时加载到父窗口中而不是iframe中?
Please note, I do not have access to change anything within the javascript inside the iframe. 请注意,我无权更改iframe中javascript中的任何内容。
<iframe>
<!-- irrelevant code -->
<!-- button generated by external javascript -->
<input class="ssc_lrBuyBtn" onclick="ssc.buyClicked(1,2)" id="ssc_BB_1" value="Buy" type="button">
</iframe>
There are no form tags around each of the buttons. 每个按钮周围没有表单标签。 The urls that the buttons call change regularly.
按钮调用的网址会定期更改。 Could I add javascript before or after the iframe to make the buttons open in the parent window?
我可以在iframe之前或之后添加javascript,以在父窗口中打开按钮吗? As of now, I have tried the base tag and a js snippet that is supposed to change the target, however, I think they only work for links, not buttons.
到目前为止,我已经尝试了基本标记和应该更改目标的js代码段,但是,我认为它们仅适用于链接,而不适用于按钮。
Any help is greatly appreciated! 任何帮助是极大的赞赏!
onsubmit="window.opener.location.reload();"
might help. 可能有帮助。 Check out this thread: Refresh Parent Window with JS
签出此线程: 使用JS刷新父窗口
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.