Script TH and defer attribute (#15948)

pull/15950/head
Luke Latham 2019-12-02 13:50:41 -06:00 committed by GitHub
parent 6b5f9cca20
commit 8ba150cf55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -4,7 +4,7 @@ author: rick-anderson
ms.author: riande
description: Discover the ASP.NET Core Script Tag Helper attributes and the role each attribute plays in extending behavior of the HTML Script tag.
ms.custom: mvc
ms.date: 12/18/2018
ms.date: 12/02/2019
uid: mvc/views/tag-helpers/builtin-th/script-tag-helper
---
# Script Tag Helper in ASP.NET Core
@ -28,6 +28,8 @@ The following Razor markup shows a `script` element with a fallback:
</script>
```
Don't use the `<script>` element's [defer](https://developer.mozilla.org/docs/Web/HTML/Element/script) attribute to defer loading the CDN script. The Script Tag Helper renders JavaScript that immediately executes the [asp-fallback-test](#asp-fallback-test) expression. The expression fails if loading the CDN script is deferred.
## Commonly used Script Tag Helper attributes
See [Script Tag Helper](xref:Microsoft.AspNetCore.Mvc.TagHelpers.ScriptTagHelper) for all the Script Tag Helper attributes, properties, and methods.