Hacker News new | ask | show | jobs
by rarestblog 5732 days ago
Sorry, but you aren't right. Those are mostly located in body tag. They are requested as soon as encountered by browser, because they might issue "document.write", so the execution of rest of HTML is delayed until that "src" is loaded. That's exactly what causes the problem. Putting script into body doesn't defer its execution.

I'm not sure how browsers render <script src in head, but probably the same.

2 comments

Works same in the head. All scripts if not set to asynchronous will prevent further rendering of the page until the script has finished loading and running.
oh, ok, thanks! i would have made the assumption that this would have fixed it and been frustrated.