Javascript will not run after the update
Answered
Hallo,
I have defined 3 variables in geogebra ... ZC, C1, C2.
Using the InputBox(ZC), I change the value of the ZC variable from the keyboard. In the InputBox settings, I will run javascript after the update:
{ ggbApplet.setValue("C1", ggbApplet.getValue("ZC")); }
After changing the value of the variable ZC, the value C1 will also change.
I want to run another javascript in the properties of variable C1 after updating this variable. However, it will not start. It only starts when I change the value from the keyboard in the InputBox (C1).
I found the RunUpdateScript () command in the manual, but it probably only works with geogebra scripts, not with java scripts.
Can anyone advise me please?
Thank you
Please post your .ggb file
Why are you using JavaScript? I think it will be much easier using GeoGebra commands, eg to reverse a string
un cambio de valor de una variable mediante/dentro de un script o javascript no pone en marcha el on update script de esa variable para evitar bucles infinitos
el usuario debe forzar su ejecución con un RunUpdateScript( <Object> ) dentro del script que cambia el valor de la variable. Dentro del script se puede comprobar si la variable ha cambiado mediante su almacenamiento en otra variable de uso temporal
runupdatescript() es un comando de GG no es java
si tu quieres usar un comando GG desde java debes escribir
ggbApplet.evalCommand('RunUpdateScript( "C1" )') o algo similar
pero insisto como Michael,¿Por qué hacer con java o con script algo que se puede hacer desde GG con facilidad?
mi experiencia me dice que casi nunca es necesario un script y mucho menos javascript y que cuando se usa sin ser necesario todo se vuelve un problema
Comments have been locked on this page!