0

We have embedded a form via iFrame on our website. When the form has been sent, a new URL should be called.

On the desktop (Chrome browser), the redirect works. On iOS on the iPhone, the window freezes when you submit the form.

Do you know what is causing this or what is triggering this error in the code?

Here is our Code:

<script type="text/javascript">
(function () {
    var d = document,
        s = d.createElement('script');
    s.src = 'https://kitarinocockpit.nemborn.com/Script/NemPlads/preregister-v1.0.0.1.js';
    s.id = 'nemplads-script';
    s.setAttribute('data-timestamp', +new Date());
    window.addEventListener('success', function (e) {
        const items = document.location.search.substr(1).split("&");
        for (let index = 0; index < items.length; index++) {
            const getParam = items[index].split("=");
            if (getParam[0] === 'id') {
                document.location.href = 'https://www.kitarino.net/bestatigung-platzanfrage?id=' + decodeURIComponent(getParam[1]);
                break;
            }
        }
    });
    (d.head || d.body).appendChild(s);
})();    
</script>
starball
  • 20,030
  • 7
  • 43
  • 238
Alex
  • 1
  • 1
  • Are you using Chrome or Safari on iOS? – FiddlingAway Jan 06 '23 at 22:07
  • i am using safari – Alex Jan 07 '23 at 06:39
  • Two additional questions: 1) Can you verify that Safari's window is freezing on iOS? By that, I mean - after submitting the form, can you, in any way, interact with other elements on the page (click a button, select a part of the text, scroll up and down, etc)? 2) Are you trying to redirect the main page from the iframe? That is to say, does the iframe contain `document.location.href(....)`? – FiddlingAway Jan 07 '23 at 10:20
  • Hello, 1) sorry, the tab freezes, Safari I can still operate. to 2) maybe the overview will help you: Our website URL www.kitarino.net URL where we embedded the iFrame: www.kitarino.net/anfrage URL we load into the iframe: https://kitarinocockpit.nemborn.com The URL we want to load after submitting the form: www.kitarino.net/confirmation The iframe includes document.location.href only in the script, as I see it – Alex Jan 09 '23 at 10:43
  • If the redirection is happening from the within the iframe, then you might find [this useful](https://stackoverflow.com/a/3193193/6133426). – FiddlingAway Jan 09 '23 at 18:09

0 Answers0