DEV Community

Discussion on: CSS, JavaScript, and blocking web page parsing

Collapse
 
sandhilt profile image
Bruno Ochotorena

I think that async allow code execute without stop parse of html.
Read here:
"If async is present: The script is executed asynchronously with the rest of the page (the script will be executed while the page continues the parsing)"
source: w3schools.com/tags/att_script_asyn...

Collapse
 
rahulmanek profile image
rahulmanek

Yes i also definitely agree with this.
async executes while HTML loading.
Checked with idevelop.pro/ consoles.

Collapse
 
faheem_khan_dev profile image
Faheem Khan

This is not correct.
If async ia there, script "download" happens asynchronously not the execution.

Collapse
 
sandhilt profile image
Bruno Ochotorena

Look in source:
"If the async attribute is set, the script is downloaded in parallel to parsing the page, and executed as soon as it is available."

Collapse
 
sandhilt profile image
Bruno Ochotorena