GeoGebraApplet: java2javascript interface added

Markus Hohenwarter shared this question 14 years ago

Hello everyone,

I have implemented an Applet to JavaScript interface for the GeoGebraApplet. You can now have JavaScript functions that listen for object updates, new objects, deleted objects, etc. in the applet's construction. This means that the GeoGebraApplet can now actively influence your website. Furthermore, this is a way to let two GeoGebraApplets communicate with each other (in both directions!) by providing JavaScript code in the webpage as a bridge.

The new features are included in the latest pre-release. Please have a look at the details in

an example:

I will now go on to create a new method for "getAllObjectNames()" as it only works on Firefox and not with IE.

All the best,


Comments (4)


Hi Markus

Thanks for this. An excellent feature.

I tried it with Firefox and noticed this:

Clicking the Reset icon or the browser Refresh button resets the construction as expected.

But if the 'Listen for updates' checkbox has been checked the checkbox and the Listener output appear to freeze.

Clicking the checkbox unfreezes and clears them.

All the Best

Zen Biker Maniac


The browser refresh/reload button can be made to reset the form.

Insert a call to resetForm() into the body tag:

<body onLoad="resetForm()">

Insert a new function resetForm() after the <script ...> tag:

<script type="text/javascript">

function resetForm() {

document.listenerForm.textfield.value = "";

document.listenerForm.textarea.value = "";;;;

} //end resetForm

The problem remains with the GeoGebra reset icon.

Zen Biker Maniac


Yes, I know about this problem in Firefox, but could not find a solution for it, as I am not really sure what causes the problem. With IE it did not occur.

So, simply avoid the reset icon when using Java2Javascript.

I have updated the java2javascript interface a little bit and

added another example for applet to applet communication:


All the best,




I'it exactly what I need, it's wonderfull. But when do you sleep ;)

© 2021 International GeoGebra Institute