Difference between revisions of "Displaying GEONExT constructions"

From JSXGraph Wiki
Jump to navigationJump to search
Line 5: Line 5:
 
<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', 'http://jsxgraph.uni-bayreuth.de/geonext/Unendlich.gxt', 'Geonext');
+
   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="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraph.css" />
 
<link rel="stylesheet" type="text/css" href="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraph.css" />
Line 14: Line 15:
 
<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', '/geonext/Unendlich.gxt', 'Geonext');
+
   JXG.JSXGraph.loadBoardFromFile('box', '/geonext/viereck_gleiter_seiten.gxt', 'Geonext');
</script>
 
</html>
 
 
 
Another example:
 
<source lang="xml">
 
<div id="box2" class="jxgbox" style="width:500px; height:500px;"></div>
 
<script type="text/javascript">
 
  var b2 = JXG.JSXGraph.loadBoardFromFile('box2', '/geonext/viereck_gleiter_seiten.gxt', 'Geonext');
 
</script>
 
</source>
 
 
 
<html>
 
<div id="box2" class="jxgbox" style="width:500px; height:500px;"></div>
 
<script type="text/javascript">
 
  var b2 = JXG.JSXGraph.loadBoardFromFile('box2', '/geonext/viereck_gleiter_seiten.gxt', 'Geonext');
 
 
</script>
 
</script>
 
</html>
 
</html>

Revision as of 14:20, 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 b2 = JXG.JSXGraph.loadBoardFromFile('box', '/geonext/viereck_gleiter_seiten.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. This has the advantage that the HTML file is complete. Here is an example:

<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>