If it is running in a browser: no. Unfortunately.
You may be able to do this in the server code in advance (for example, Python or PHP, which can call C) when linking the contents of the page. Alternatively, you can make an AJAX request to a server that provides the C function as an HTTP API / endpoint (via, GCI, FCGI, or Python / PHP / Perl). But not in the browser.
This is because JS works in an isolated virtual environment that does not have access to system calls or anything outside the runtime.
EDIT
In response to your comment, "the script is executed in C using HTML_WriteToCgi", this means that you are collecting HTML code in C on your server. If this is correct, go to my option 1 above by entering the values directly into the JS source code if all the values come from some data known to the server.
You might consider porting some features from the JS browser and back to server code to solve your problem.
source share