Displaying GEONExT constructions: Difference between revisions
From JSXGraph Wiki
No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
(14 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
into the division with the id "box". | into the division with the id "box". | ||
<source lang="xml"> | <source lang="xml"> | ||
<link rel="stylesheet" type="text/css" href="//jsxgraph.org/distrib/jsxgraph.css" /> | |||
<script type="text/javascript" src="//jsxgraph.org/distrib/jsxgraphcore.js"></script> | |||
<script type="text/javascript" src="//jsxgraph.org/distrib/geonext.min.js"></script> | |||
<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 | var b2 = JXG.JSXGraph.loadBoardFromFile('box', '/geonext/viereck_gleiter_seiten.gxt', 'Geonext'); | ||
</script> | </script> | ||
</source> | </source> | ||
<html> | <html> | ||
<link rel="stylesheet" type="text/css" href=" | <link rel="stylesheet" type="text/css" href="//jsxgraph.org/distrib/jsxgraph.css" /> | ||
<script type="text/javascript" src=" | <script type="text/javascript" src="//jsxgraph.org/distrib/jsxgraphcore.js"></script> | ||
<script type="text/javascript" src=" | <script type="text/javascript" src="//jsxgraph.org/distrib/geonext.min.js"></script> | ||
<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"> | ||
JXG.JSXGraph.loadBoardFromFile('box', '/geonext/viereck_gleiter_seiten.gxt', 'Geonext'); | |||
</script> | </script> | ||
</html> | </html> | ||
=== [[Another example for displaying GEONExT]] === | |||
=== Loading a GEONExT construction from a string === | === Loading a GEONExT construction from a string === | ||
Line 39: | Line 30: | ||
Here is an example: | Here is an example: | ||
<source lang="xml"> | <source lang="xml"> | ||
<link rel="stylesheet" type="text/css" href="http://jsxgraph.org/distrib/jsxgraph.css" /> | |||
<script type="text/javascript" src="http://jsxgraph.org/distrib/jsxgraphcore.js"></script> | |||
<script type="text/javascript" src="http://jsxgraph.org/distrib/geonext.min.js"></script> | |||
<div id="box3" class="jxgbox" style="width:500px; height:500px;"></div> | <div id="box3" class="jxgbox" style="width:500px; height:500px;"></div> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
Line 51: | Line 45: | ||
</script> | </script> | ||
</html> | </html> | ||
[[Category:Examples]] | |||
[[Category:Geometry]] |
Latest revision as of 16:51, 24 June 2020
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".
<link rel="stylesheet" type="text/css" href="//jsxgraph.org/distrib/jsxgraph.css" />
<script type="text/javascript" src="//jsxgraph.org/distrib/jsxgraphcore.js"></script>
<script type="text/javascript" src="//jsxgraph.org/distrib/geonext.min.js"></script>
<div id="box" class="jxgbox" style="width:500px; height:500px;"></div>
<script type="text/javascript">
var b2 = JXG.JSXGraph.loadBoardFromFile('box', '/geonext/viereck_gleiter_seiten.gxt', 'Geonext');
</script>
Another example for displaying GEONExT
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. This has the advantage that the HTML file is complete. Here is an example:
<link rel="stylesheet" type="text/css" href="http://jsxgraph.org/distrib/jsxgraph.css" />
<script type="text/javascript" src="http://jsxgraph.org/distrib/jsxgraphcore.js"></script>
<script type="text/javascript" src="http://jsxgraph.org/distrib/geonext.min.js"></script>
<div id="box3" class="jxgbox" style="width:500px; height:500px;"></div>
<script type="text/javascript">
var brd = JXG.JSXGraph.loadBoardFromString('box3', 'eNrtXOtv48YR/2z9FQv...+A+Ve+/sNQRlkZsVVddkvk/CpkHvA==', 'Geonext');
</script>