Bringing in a function from javascript into html -
new web programming need make web app existing c++ code. have gotten existing c++ code compile in javascript. can output values in js file function called sample(), cannot figure out how bring function html front end have can use these generated values.
thanks can give.
place code inside script tag:
<script> var func = function() { // ... } </script>
to show inside html element:
<div id="my-element"></div> <script> var func = function() { return 'result'; } window.onload = function() { document.getelementbyid("my-element").innerhtml = func(); } </script>
Comments
Post a Comment