Preface
No matter whether the current JavaScript code is embedded or in an external link file, the downloading and rendering of the page must stop and wait for the script execution to complete. The longer the JavaScript execution process takes, the longer the browser waits to respond to user input. The reason why browsers block when downloading and executing scripts is that the script may change the namespace of the page or JavaScript, which affects the content of subsequent pages.
A typical example is to use document.write() on the page.
JavaScript code inline example
<html> <head> <title>Source Example</title> </head> <body> <p> <script type="text/javascript"> document.write("Today is " + (new Date()).toDateString()); </script> </p> </body> </html>
When the browser encounters the