By my understanding async scripts are executed before document parsing finished and defer scripts after that. But what about their relation to the window.onload event?
If I understand correctly async scripts are guaranteed to run before window onload and deferred may execute after that. Is that right? Or are both of these kinds of scripts always executed before window onload?
async
scripts are just queued up in the async queue and executed as soon as the engine pick them from there. I'm not sure there's any relation with thewindow.onload
event. – MarcoL