From 04792563e216f57984219e582de491947e2d7f40 Mon Sep 17 00:00:00 2001 From: natrixaeria Date: Sat, 25 May 2019 02:40:00 +0200 Subject: Manipulate DOM --- WebInterface/wasm/asm-paint/src/lib.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'WebInterface/wasm/asm-paint/src') diff --git a/WebInterface/wasm/asm-paint/src/lib.rs b/WebInterface/wasm/asm-paint/src/lib.rs index 52ddc8f..462a89d 100644 --- a/WebInterface/wasm/asm-paint/src/lib.rs +++ b/WebInterface/wasm/asm-paint/src/lib.rs @@ -12,5 +12,16 @@ extern "C" { #[wasm_bindgen(start)] pub fn entry() { + use web_sys; console_log!("hello {} wasm", 42); + + let window = web_sys::window().unwrap(); + + let document = window.document().unwrap(); + + let body = document.body().unwrap(); + + //body.set_inner_html("

Hello from WASM

"); + + body.set_inner_html("oho"); } -- cgit v1.3.1