Search code examples
javascriptiframepostparentpci-dss

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?

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. We are PCI compliant and thus we cannot use window.parent.location = url;


Solution

  • What it boils down to, it seems, is this:
    1. You get a text url from a 3rd party in the iframe.
    2. You want to change your page's location to that url.
    3. Unless you have control over that 3rd party, all you are going to get is that text url.

    Now, the only way to change your page's location automatically is with window.parent.location (or 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.