Displaying GEONExT constructions: Difference between revisions
From JSXGraph Wiki
No edit summary |
No edit summary |
||
Line 14: | Line 14: | ||
<div id="box" class="jxgbox" style="width:500px; height:500px;"></div> | <div id="box" class="jxgbox" style="width:500px; height:500px;"></div> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
var brd = JXG.JSXGraph.loadBoardFromFile('box', ' | var brd = JXG.JSXGraph.loadBoardFromFile('box', '/geoenext/pythagoras.gxt', 'Geonext'); | ||
</script> | </script> | ||
</html> | </html> |
Revision as of 12:06, 17 September 2008
Loading a GEONExT construction from a file
Here, we load the content of the GEONExT file "pythagoras.gxt" into JSXGraph, i.e. into the division with the id "box".
<div id="box" class="jxgbox" style="width:500px; height:500px;"></div>
<script type="text/javascript">
var brd = JXG.JSXGraph.loadBoardFromFile('box', 'pythagoras.gxt', 'Geonext');
</script>
Loading a GEONExT construction from a string
The content of a GEONExT file is a string which contains the GEONExT XML description of the construction compressed by gzip and encoded with base64. This string can be written directly into the HTML file. Here is an example:
<div id="jxgbox2" class="jxgbox" style="width:500px; height:500px;"></div>
<script type="text/javascript">
var brd = JXG.JSXGraph.loadBoardFromString('jxgbox2', 'eNrtXOtv48YR/2z9FQv...+A+Ve+/sNQRlkZsVVddkvk/CpkHvA==', 'Geonext');
</script>