Embed multiple Applets.

0 votes
asked by about GeoGebra
edited by

"For multiple applets on one page, by default only one is accessible from JavaScript. To access multiple applets, you should set the "ID" parameter of particular applets, it will become the name of global variable representing the applet".

Can you please give me an example of how to set the ID parameter and call a specific applet? Thank you!

1 Answer

0 votes
No avatar answered by (236k points)
edited by

GeoGebra application features an online Wiki website where all the features and functions are listed. Visit the one related to JavaScript and you will find the necessary commands and codes to set the ID parameter and call applets. Every command is explained and detailed.

commented by (100 points)
Thank you for your answer, but I already read this site (my citation is from this website) and didn't found the right code.
Maybe I should give you my code to underline my problem:

<!-- <script type="text/javascript" src="//www.geogebratube.org/scripts/deployggb.js"></script>
<script type="text/javascript">
applet1 = new GGBApplet({material_id: "xxxxxxx"}, true);
applet2 = new GGBApplet({material_id: "xxxxxxx"}, true);
window.onload = function()
{applet1.inject('applet_container1', 'preferHTML5');
applet2.inject('applet_container2', 'preferHTML5'); }</script>
<div style="width:843px;height:607px;display:block" id="applet_container1"></div>
<div style="width:843px;height:607px;display:block" id="applet_container2"></div>
<input onclick="document.ggbApplet.setVisible('a',true)" value="Zeige L&ouml;sung" type="button"> -->

But the input always changes applet2.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register
...