-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimum in HTML to run emscripten generated file.js #1326
Comments
script src="test.js"></script>
main() /script> textarea class="emscripten" id="output" rows="20"></textarea> |
That's basically it, yes. Define Module.print and printErr and a console app can work, add Module.canvas to get rendering. See src/shell.html for the default stuff. |
Due to the happenstance of Google's SEO, this issue comes up when searching for simple templates to use with the generated JavaScript file in HTML without the additional scaffolding that doing Below is the most basic HTML I was able to get working with Emscripten:
The code above appears in my BASIC to C to WebAssembly project repository. My included sample BASIC code brute forces the primes up to 1000 and "prints" them. This skeleton HTML provides the means to retrieve that output and redirect it to the page in the form of a |
I know i can compile via
python emcc test.cpp -o test.html
But know i want to use the generated Javascript code in an existing webpage
or page with own layout.
Therefore i compile it like the following:
python emcc test.cpp -o test.js
and want to include the test.js manually into a webpage.
What is the minimum needed in a HTML file
to call and run an emscripten generated JavaScript program?
The program needs only printf to a textarea in main and
emscripten API calls like emscripten_set_main_loop,
emscripten_async_wget2, ... no "graphical" output.
Something like:
text is not displayed by github, rework in second windows...
The text was updated successfully, but these errors were encountered: