Skip to content

Instantly share code, notes, and snippets.

@yuri91
Last active May 15, 2020 09:43
Show Gist options
  • Save yuri91/431417d404dede95be9b8cd1728dc3eb to your computer and use it in GitHub Desktop.
Save yuri91/431417d404dede95be9b8cd1728dc3eb to your computer and use it in GitHub Desktop.
Access client globals
#include <cheerp/client.h>
[[cheerp::wasm]]
[[cheerp::jsexport]]
client::Element* global(const char* cl)
{
client::String* clJS = new client::String(cl);
client::Element* elem = client::document.createElement("div");
elem->set_className(*clJS);
return elem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment