简体   繁体   English

有什么方法可以代替JS hack,可以将iframe从iframe发布到iframe之外的其他页面?

[英]Is there any way instead of a JS hack where I can post from an iframe to another page outside the iframe?

Is there any way instead of a JS hack where I can post from an iframe to another page outside the iframe? 有什么方法可以代替JS hack,可以将iframe从iframe发布到iframe之外的其他页面?

the iframe is posting data to a 3rd party and then just responding back with a URL which is the redirection URl thus we cannot set the form target. iframe将数据发布到第三方,然后仅以URL(作为重定向UR1)进行响应,因此我们无法设置表单目标。 We are PCI compliant and thus we cannot use window.parent.location = url; 我们符合PCI标准,因此不能使用window.parent.location = url;

What it boils down to, it seems, is this: 它看起来可以归结为:
1. You get a text url from a 3rd party in the iframe. 1.您从iframe中的第3方获得了文本网址。
2. You want to change your page's location to that url. 2.您想要将页面的位置更改为该URL。
3. Unless you have control over that 3rd party, all you are going to get is that text url. 3.除非您控制该第三方,否则您将获得的只是该文本URL。

Now, the only way to change your page's location automatically is with window.parent.location (or window.location .) 现在,唯一自动更改页面位置的方法是使用window.parent.location (或window.location

If changing the url of the page with javascript is not PCI compliant then you're trying to do something that is not PCI complicant. 如果使用javascript更改页面的网址不符合PCI,则您正在尝试执行与PCI不兼容的操作。

<form>接受目标参数,例如target =“ _ parent”

在锚标记中,您可以设置target='_parent'这将导致将该网址加载到父窗口中。

No , the only way is by using javascript. ,唯一的方法是使用javascript。 But it's not really a hack to use window.parent.location = url; 但是使用window.parent.location = url;并不是真正的黑客window.parent.location = url;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM