Having following code
<iframe id="myframe" src="..."></iframe>
<script>
document.getElementById('myframe').onload = function() {
alert('myframe is loaded');
};
</script>
i wonder how does the browser processes an iframes? Does it load the iframe content in the separate thread? If so is it run synchronously with the main thread?
That depends stronly to the browser. Internet Explorer for example starts a seperated thread for each tab you open, some might do that otherwise. Actually, some browsers support specially secured threads for frames: https://www.chromium.org/developers/design-documents/oop-iframes
So, which browser are you asking for especially?
The iframe is loading sync with the main website. If you want to load the content of the main site first
<body onload="javascript:...">