Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
Apparently, my form was inside an iframe. In order for me to redirect I had to change location of parent document, like so: <script type="text/javascript"> if (window.self != window.top...
Answer
#2: Post edited
- Apparently, my form was inside an iframe. In order for me to redirect I had to change location of parent document, like so:
- ```
- <script type="text/javascript">
- if (window.self != window.top)
parent.document.location.href = "#local.redirectURL#";- else
location.href = "#local.redirectURL#";- </script>
- ```
- Apparently, my form was inside an iframe. In order for me to redirect I had to change location of parent document, like so:
- ```
- <script type="text/javascript">
- if (window.self != window.top)
- parent.document.location.href = "https://duckduckgo.com";
- else
- location.href = "https://duckduckgo.com";
- </script>
- ```
#1: Initial revision
Apparently, my form was inside an iframe. In order for me to redirect I had to change location of parent document, like so: ``` <script type="text/javascript"> if (window.self != window.top) parent.document.location.href = "#local.redirectURL#"; else location.href = "#local.redirectURL#"; </script> ```