gpt4 book ai didi

html - 使用两个嵌套的 iframe 时防止打开新选项卡

转载 作者:行者123 更新时间:2023-11-28 01:43:00 25 4
gpt4 key购买 nike

你好 stackoverflow 伙计们,我在这里遇到了一个问题。我给了一个iframe代码给其他人以将其嵌入他的网站。

这里是iframe的代码:

  <iframe height="100%" width="100%" frameborder="0" scrolling="auto" src="http://www.mywebsite.com/iframecode" type= "text/javascript"></iframe> 

以上iframe包含以下 html :

<html>
<head>
</head>
<body>
//... some html code
<iframe src="http://www.paymentgatway.com/pay" height="100%" width="100%" frameborder="0" scrolling="auto"></iframe>
//... some html code
</body>
</html>

在上面html包含另一个 iframe用于付款(第三方)。

问题:

所以问题是当他点击第二个支付按钮时 iframe ,它会将 3D 安全页面打开到新选项卡,而不是将其打开到同一页面。

我试过了 <base target="_self"/><head>我的 iframe html 的标签,但运气不好。

我已经测试过直接使用支付 iframe,当我点击支付按钮时它会在同一个窗口中打开。

拜托,你能改变我的运气吗?

最佳答案

我看到了两件重要的事情:

  1. 混合 HTTPHTTPS 不是一个好的做法(除非你试图欺骗某人) 即使你这样做,通常安全页面或浏览器将阻止您。
  2. 如果 paymentgatway.com 编码正确,则出于安全原因,它不会允许您在 iframe 中加载

因此,基于:

I have tested using payment iframe directly, when I click pay button it opens in same window.

我会说你在这里面临这两种情况。

结论:
除非您拥有这两个域并且可以修改 paymentgatway.com 页面的源代码,否则您不能这样做。

关于html - 使用两个嵌套的 iframe 时防止打开新选项卡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24696269/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com