I am trying to breakout of an iFrame after a form is submitted. After the form is submitted it should end up at example.org/thankyou, for example. I have tried various options but I think the best way to do it is to navigate to a controller and then have that controller load JavaScript for the redirect.
I have tried both window.parent.location.href = "https://example.org/" and window.parent.location = "https://example.org/" in the JavaScript and neither of them work. They do not appear to do anything. There are no JavaScript errors in the Chrome DeveTools.
My custom JavaScript that I am loading in the controller is in the JS that is delivered when the page is loaded. This is verified by loading the JS file through the ChromeDevTools.
The code is loaded at the end of the HTML document. I am almost wondering if this is being called to late in the page render process.
Any help is greatly appreciated.
Thanks!