script defer/async Execution Order Table
Classifies execution scheduling of ordinary parser-inserted classic or module scripts. Async wins over defer; inline classic flags are ignored. This assumes scripting enabled and successful fetch/evaluation, without dynamic insertion or blocking attributes.
Description
Script loading and execution can block parsing, wait until parsing completes, or run when ready.
Script loading and execution can block parsing, wait until parsing completes, or run when ready. Classic and module scripts use different default scheduling rules.1
Classifies execution scheduling of ordinary parser-inserted classic or module scripts. Async wins over defer; inline classic flags are ignored. This assumes scripting enabled and successful fetch/evaluation, without dynamic insertion or blocking attributes.
When to use script defer/async Execution Order Table
Use this for the following task: Classifies execution scheduling of ordinary parser-inserted classic or module scripts. Async wins over defer; inline classic flags are ignored. This assumes scripting enabled and successful fetch/evaluation, without dynamic insertion or blocking attributes.
Prepare the parsed attribute values, element states or ordered local lists requested below. Keep attribute presence separate from value.
How to use script defer/async Execution Order Table and understand its results
- Prepare the parsed attribute values, element states or ordered local lists requested below. Keep attribute presence separate from value.
- Enter kind, external, async, defer using the field table, then run the tool.
- Read phase, parserBlocking, orderedWithDeferred. Interpret flags, units, ordering and placeholder values using the rules below.
- Review any reported issue or failed check, correct the supplied values when appropriate, and verify the result in its intended context.
| Input field | Meaning | Value type and bounds | Requirement |
|---|---|---|---|
| kind | Kind | string; choose "classic", "module" | Required |
| external | External | boolean | Required |
| async | Async | boolean | Required |
| defer | Defer | boolean | Required |
Describe an ordinary parser-inserted script. Async takes priority; otherwise modules or external deferred classic scripts run after parsing. Other classic scripts run during parsing. Inline classic async/defer flags have no effect here.2
asyncEffective = async AND (module OR external); deferred = !asyncEffective AND (module OR (external AND defer)) This summarizes the declared operation. Units, indexing, inclusivity and exceptional cases are explained in the surrounding text.
| Output field | Meaning | Value type |
|---|---|---|
| phase | Phase | string |
| parserBlocking | Parser Blocking | boolean |
| orderedWithDeferred | Ordered With Deferred | boolean |
{
"input": {
"kind": "classic",
"external": true,
"async": false,
"defer": true
},
"output": {
"phase": "after-parsing",
"parserBlocking": false,
"orderedWithDeferred": true
}
} Limitations and assumptions
Scripting must be enabled and fetching/evaluation successful. Dynamically inserted scripts, blocking attributes and precise network timing are excluded.
This evaluates supplied local information; it does not fetch a page or run a browser. Malformed requests produce input errors. A successfully evaluated request can still contain false flags, empty result lists or a result outside the supplied threshold; those outcomes have the meanings stated above.
Alternative or Complementary methods
Choose Module vs Classic Script Diff Lookup for this operation: Returns standard language facts for module or classic scripts: automatic strict mode, module scope and top-level var global binding. Classic scripts can opt into strict mode separately. For a complementary task, use noscript JS-Disabled Fallback for this operation: Resolves HTML noscript fallback and parser treatment from the HTML parser scripting flag. With scripting enabled contents are text; with scripting disabled contents are markup. XML parsing and full content-model validation are outside this tool.
Further background: HTML / accessibility reference: script defer/async Execution Order Table.
References
Similar or alternative tools
- Module vs Classic Script Diff Lookup
Returns standard language facts for module or classic scripts: automatic strict mode, module scope and top-level var global binding. Classic scripts can opt into strict mode separately.
- noscript JS-Disabled Fallback
Resolves HTML noscript fallback and parser treatment from the HTML parser scripting flag. With scripting enabled contents are text; with scripting disabled contents are markup. XML parsing and full content-model validation are outside this tool.