| Roundtrip response time: | ||
Examples 6, 7, and 8 all contain the following components in this order:
- a 2 second script
- an iframe containing a 10 second script
- a 2 second script
- a 2 second script
In this example, the iframe SRC is set dynamically.
We might hope that this would mean its 10 second script would not block the onload event,
so the page would load in 6 seconds (the time to download the three 2 second scripts sequentially).
In reality it takes ~12 seconds to load, the same as the previous example.
Setting the iframe SRC dynamically doesn't get around the iframe's (slow) script blocking the onload event.
In the next example we'll try creating the slow script dynamically.