Struct patternfly_dioxus::dioxus_elements::script
[−]pub struct script;Expand description
Implementations
impl script
impl script
pub fn crossorigin(
&self,
cx: NodeFactory<'a>,
val: Arguments<'_>
) -> Attribute<'a>
pub fn crossorigin(
&self,
cx: NodeFactory<'a>,
val: Arguments<'_>
) -> Attribute<'a>
Normal script elements pass minimal information to the window.onerror for scripts which do not pass the standard CORS checks. To allow error logging for sites which use a separate domain for static media, use this attribute. See CORS settings attributes for a more descriptive explanation of its valid arguments.
pub fn defer(&self, cx: NodeFactory<'a>, val: Arguments<'_>) -> Attribute<'a>
pub fn defer(&self, cx: NodeFactory<'a>, val: Arguments<'_>) -> Attribute<'a>
This Boolean attribute is set to indicate to a browser that the script is meant to be executed after the document has been parsed, but before firing DOMContentLoaded.
Scripts with the defer attribute will prevent the DOMContentLoaded event from firing until the script has loaded and finished evaluating.
Warning:
This attribute must not be used if the src attribute is absent (i.e. for inline scripts), in this case it would have no effect.
The defer attribute has no effect on module scripts — they defer by default. Scripts with the defer attribute will execute in the order in which they appear in the document.
This attribute allows the elimination of parser-blocking JavaScript where the browser would have to load and evaluate scripts before continuing to parse. async has a similar effect in this case.