Using mulitple ggbBase64 files in a single HTML file

Richard Parkin shared this question 3 years ago
Answered

I'm trying to put a file together that has 2 GeoGebra (ggbBase64) files in a single html file. The code I am using is below (just copied once but a second string with ID set as 2 would follow. Question/problem is even though I have the ID# set as 1 and 2, only the #2 file shows, but it shows up twice, once where ID#1 should be and second where it should be. Anyone know what I'm doing wrong?

<div id="1" class="bounds" style="max-width:1025px; max-height:625px; overflow:hidden"></div>

<!--<script type="text/javascript" src="GeoGebra/deployggb.js"></script>-->

<script src="https://cdn.geogebra.org/ap...;

<script>

var parameters = {

"width": 814,

"height": 541,

"prerelease": false,

"showToolBar": false,

"borderColor": "white",

"showMenuBar": false,

"showAlgebraInput": false,

"customToolbar": "0 || 1",

"showResetIcon": true,

"scaleContainerClass": "bounds",

"enableLabelDrags": false,

"enableShiftDragZoom": false,

"enableRightClick": false,

"capturingThreshold": null,

"showToolBarHelp": true,

"errorDialogsActive": true,

"useBrowserForJS": false,

"ggbBase64": "my ggbBase64 code is here"

};

var ggbApp = new GGBApplet(parameters, true);

window.addEventListener("load", function() {

ggbApp.inject('1');

});

</script>

Comments (2)

photo
2

Thanks, my son figured it out for me. I needed a unique identifier for "ggbApp" in the last line, works perfectly when they are called ggbApp1 and ggbApp2.

var ggbApp = new GGBApplet(parameters, true);

window.addEventListener("load", function() {

ggbApp.inject('1');

© 2023 International GeoGebra Institute