Add a minimal and plain stdweb example

This commit is contained in:
2018-09-08 23:38:34 -04:00
parent ab6e31770d
commit 5cb79f2828
27 changed files with 16026 additions and 17 deletions

18
stdweb/src/lib.rs Normal file
View File

@ -0,0 +1,18 @@
#![feature(custom_attribute)]
extern crate stdweb;
extern crate wasm_bindgen;
use wasm_bindgen::prelude::*;
use stdweb::web::document;
use stdweb::web::INode;
use stdweb::web::IElement;
#[wasm_bindgen]
pub fn run() {
let doc = document();
let val = doc.create_element("p").unwrap();
val.set_attribute("innerHTML", "IT IS ALIVE").unwrap();
doc.body().unwrap().append_child(&val);
}