我正在构建一个嵌入式表单,类似于Stripe的表单。
这是演示代码。
<form action="/charge" method="POST">
<script
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="pk_test_6pRNASCoBOKtIshFeQd4XMUh"
data-amount="2000"
data-name="Stripe.com"
data-description="2 widgets"
data-image="/img/documentation/checkout/marketplace.png"
data-locale="auto">
</script>
</form>
<h5>This button still works after close iframe within iframe.</h5>
<button onclick="alert('hi');">Alert</button>
&#13;
https://jsfiddle.net/sq5zs5rq/3/
我想了解,Stripe&#34;关闭模式&#34; (X)按钮,实际上关闭了整个iframe,剩下的网页仍然有用。
我接过了这个,但它不能使用Cross浏览器。 Close iframe cross domain
我还尝试制作iframe主体(显示:无),但除非您刷新页面,否则整个网站都不起作用。
有人可以解释或提供解决方案吗?