Dear emscripten experts,

I have a naive question regarding passing parameters between html and wasm 
binary. forgive me if this is too basic.

I copied the emcc generated .wasm, .js and .html file into a public folder, 
and I was able to see the output for my program (c code with a main() 
function) as if there is no argument is provided, see

https://kwafoo.coe.neu.edu/~fangq/share/temp/webmmc/webmmc.html

next step, I would like to add a few input fields in the html, and let user 
to define some input parameters, and then click a button to execute my wasm 
binary using the user defined parameters. As a simple test, I added on the 
top right of the html a test field named "Command input" and "Run command 
button". When click on the Run command button, the following function will 
be called

      function run_mmc_param(){
        var input = document.getElementById('mmcparam').value;
        input = input.split(" ");
        Module['arguments'] = input;
        run(input);
      }

however, no matter what I typed, nothing is printed, even an error message.

I am wondering what is the general steps to pass inputs from html to wasm 
unit? right now, my code has a main() function with argc/argv to allow 
users to pass parameters. I am curious if I can use html to customize 
inputs.

thanks

Qianqian

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to