Quantcast
Viewing all articles
Browse latest Browse all 40524

Emscripten how to pass variables from JavaScript to oF?

Ok I had a look at the document
so using the funtion emscripten_run_script works Image may be NSFW.
Clik here to view.
:smile:

here is an exemple to get a string from a html text box

in ofApp.h

#ifdef TARGET_EMSCRIPTEN
#include <emscripten/emscripten.h>
#endif`

in ofApp.cpp

#ifdef TARGET_EMSCRIPTEN
char * inputString= emscripten_run_script_string("document.getElementById('stringJava').value");
#endif

in myApp.html

input type='text' id='stringJava' />
input type='button' onclick='notEmpty()' value='Form Checker' />

Viewing all articles
Browse latest Browse all 40524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>