Class Script
Generate a standard HTML5 <script> tag
Implements
Inherited Members
Namespace: ToSic.Razor.Html5
Assembly: ToSic.Razor.dll
Syntax
public class Script : Tag<Script>, IRawHtmlString, IHtmlString, IHtmlTag, ITag, IEnumerable<ITag>, IEnumerable
Constructors
| Improve this Doc View SourceScript(String)
Declaration
protected Script(string jsonLd)
Parameters
Type | Name | Description |
---|---|---|
System.String | jsonLd |
Script(ScriptJsonLd, CloneChanges)
Very special internal overload to allow Icons to replicate
Declaration
protected Script(ScriptJsonLd original, CloneChanges changes)
Parameters
Type | Name | Description |
---|---|---|
ScriptJsonLd | original | |
ToSic.Razor.Markup.CloneChanges | changes |
Methods
| Improve this Doc View SourceAsync()
Activate the async attribute on the <script> tag
Declaration
public Script Async()
Returns
Type | Description |
---|---|
Script | a Script object to enable fluid command chaining |
Async(String)
Set the async attribute on the <script> tag
Declaration
public Script Async(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | what should be in async='...'. If called multiple times, later values replace the previous value. |
Returns
Type | Description |
---|---|
Script | a Script object to enable fluid command chaining |
Charset(String)
Set the charset attribute on the <script> tag
Declaration
public Script Charset(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | what should be in charset='...'. If called multiple times, later values replace the previous value. |
Returns
Type | Description |
---|---|
Script | a Script object to enable fluid command chaining |
Defer()
Activate the defer attribute on the <script> tag
Declaration
public Script Defer()
Returns
Type | Description |
---|---|
Script | a Script object to enable fluid command chaining |
Defer(String)
Set the defer attribute on the <script> tag
Declaration
public Script Defer(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | what should be in defer='...'. If called multiple times, later values replace the previous value. |
Returns
Type | Description |
---|---|
Script | a Script object to enable fluid command chaining |
Src(String)
Set the src attribute on the <script> tag Automatically url-encode it if contains spaces, umlauts or other unexpected chars
Declaration
public Script Src(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | what should be in src='...'. If called multiple times, later values replace the previous value. |
Returns
Type | Description |
---|---|
Script | a Script object to enable fluid command chaining |
Type(String)
Set the type attribute on the <script> tag
Declaration
public Script Type(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | what should be in type='...'. If called multiple times, later values replace the previous value. |
Returns
Type | Description |
---|---|
Script | a Script object to enable fluid command chaining |