Say one would like to add multiple interdependent JSXGraph boards to a Moodle page, but for some reason they should not be all in the same tag. In the following example, the two boards are placed in different table cells:
<table>
<tr>
<th><jsxgraph width="600" height="500" box="jxgbox0"></jsxgraph></th>
<th><jsxgraph width="500" height="500" box="jxgbox1">
... all JXG code here...
</jsxgraph></th>
</tr>
</table>
In the example above, it is a bit peculiar the JXG code rests within the second JSXGraph tag, but it works.
What I would like to is separate the code from either one of the boards and place it within some tag below the table, for example:
<table>
<tr>
<th><jsxgraph width="600" height="500" box="jxgbox0"></jsxgraph></th>
<th><jsxgraph width="500" height="500" box="jxgbox1"></jsxgraph></th>
</tr>
</table>
<script type="text/javascript">
... all JXG code here...
</script>
The problem is that this does not work. Placing the code in a third <jsxgraph>
tag actually works in the sense that the two initial boards are filled, but a third (empty) board is created.
My question now is: Is it possible to separate the JavaScript code from all of the <jsxgraph>
tags that are to be created and filled on a page?