Normally, external-file javascripts block window
's load
and DOMContentLoaded
events, like, for instance, if we were to have:
<script src="http://so.me/file.js"></script>
...then the DOM renderer would pause work as http://so.me/file.js
downloaded and executed.
Now, let's suppose that instead of the above, we have:
<script type="not-js" src="http://so.me/file.js"></script>
I know that it would download but not execute the resource, but as it downloaded, would the page renderer halt as above, or not?
There was a talk on Google I/O 2012 from Ryan Fioravanti called Building High Performance Mobile Web Applications where he used this exact technique to download scripts but prevent them from being executed. He would then execute the scripts by appending them to the DOM
.
See the part where he explains it here.
He explains that the page rendering time got significantly faster and that was because the JavaScript did not execute and prevent the page rendering procedure.
would the page renderer halt as above, or not
My answer is no. Maybe someone with more detailed knowledge about browser internals could give you a definitive answer.