0

I have an iframe tag loading additional content from another source. The embedded document performs an automatic form submission using something like <body onload="document.getElementById('form').submit()>...</body>.

Is there any way to detect when the internal form submission finishes? I tried the onload event of the iframe but apparently it doesn't wait for the embedded javascript.

And more generally, would it be possible to detect when the internal page finishes what it actually intends to do (e.g. form submission, heavy lifting javascripts, etc) for an iframe?

Kamil Naja
  • 6,267
  • 6
  • 33
  • 47
is.magl
  • 315
  • 1
  • 3
  • 8
  • Hey, Have you seen this question? https://stackoverflow.com/questions/1463581/wait-for-iframe-to-load-in-javascript – Bohdan Sviripa Feb 19 '19 at 23:58
  • finish what? a send is a send, there is no end process – Mister Jojo Feb 19 '19 at 23:59
  • *"Is there any way to detect when the internal form submission finishes?"* Yes, but there's a couple of things you need to clarify yourself: 1. Does the parent and child page reside on the same domain? 2. If not, do you own the site within the iframe? 3. If the answer to question 2 is no -- then you can do nothing to the child page at all -- forget about any ideas concerning the child page. 4. If the answer to question 1 or 2 is yes -- then post more code, preferably the code of the child page that you wanted to monitor. BTW you don't need `async-await` nor do you need `Promises`. – zer00ne Feb 20 '19 at 02:24

1 Answers1

-1

I know from typescript that there is something like await. So check this out and maybe it solves the problem:

https://javascript.info/async-await

Mr. Jo
  • 4,946
  • 6
  • 41
  • 100