Module workflow_dom::inject
source · Expand description
DOM injection utilities, allowing injection of script
and style
elements from Rust buffers using Blob
objects.
This can be used in conjunction with include_bytes
macro to embed
JavaScript scripts, modules and CSS stylesheets directly within WASM
binary.
Enums§
- The Content enum specifies the type of the content being injected Each enum variant contains optional content
id
and&[u8]
data.
Functions§
- Inject data buffer contained in the
Content
struct as aBlob
into DOM. Executes an optionalload
callback when the loading is complete. The load callback receivesweb_sys::CustomEvent
struct indicating the load result. - Inject CSS stylesheed directly into DOM as a
<style>
element usingElement::set_inner_html
- Inject script as a
Blob
buffer into DOM. Executes an optionalload
callback when the loading is complete. The load callback receivesweb_sys::CustomEvent
struct indicating the load result.