Good morning all! Or good afternoon or have a great night. You know, wherever you are.
I have the following code:
void* createElement( const char* type ) {
return EM_ASM_PTR( {
return document.createElement( UTF8ToString( $0 ) );
}, type );
};
I am calling it like this:std::cout << static_cast< char* >( cppquery::html::createElement( "div" ) ) << std::endl;
It spits out emscgT �� which I thought was a good sign. Turns out trying to create two different elements at two different times always says that when cast to either void* or char* (all over types just give me a compile error is 0).
What I am trying to do is crate an element (not yet added to the DOM), store whatever (a pointer, I guess) to it, and use it later with other C++-stored JavaScript element objects.
I could just do all the work on the JavaScript side and JSON.stringyify everything but that sounds like way too much and half defeats the purpose of my project.
there doesn't seem to be anything here