Javascript: Can't find method 5.0.593

hawe shared this question 2 months ago
Needs Answer

https://www.geogebra.org/m/fP8cnZbb (2 years old)

Javascript Error in 5.x but not in 6.x


/FUy+ax5Xi3CRI3RZunMpxfSqpTVRSXioVnToKMnAWOy9+zdBs5flyJ6gJpXEihBBCCNGExokQQgghRBMaJ0IIIYQQTWicCCGEEEI0oXEihBBCCNGExokQQgghRBMaJ0IIIYQQTf4fGwyokqjv8sEAAAAASUVORK5CYII=


if (ggbApplet.exists("X")) {
    alert("There is a Tableau X - delete or backup to continue");
    ggbApplet.evalCommand("Delete(X)");
}
var A = "" + ggbApplet.getValueString("Tableau"); <====5====
A = A.replace("Tableau =", "");
A = A.replace("{{", "");
A = A.replace("}}", "");
A = "{{" + A.replace(/;/g, "},{") + "}}";
alert("X =" + A);
ggbApplet.evalCommand("X = " + A);


Any Idea what going on?

Comments (8)

photo
1

What is Tableau string format? Upload your ggb.

photo
2

Can you see the link in upper posting?

Tableau is a Inputbox..

This App was active since 2 years without problems...

photo
1

Try getValueString((expression)+"") instead of getValueString(expression)

photo
1

Hm,

this script has been working about 2 years and do still work in gg6.

several tries nothing makes the script runing

photo
1

You can now link symbolic input boxes to matrices - that will be a better approach than JavaScript.

Also you should avoid "=" in scripts and use SetValue() if possible

photo
1

my suggestion change:

//var A = "" + ggbApplet.getValueString("Tableau"); <====5====


var A=prompt("Enter Tableau:","0,1,0,1,4; -5,4,2,6,15; -3,2,1,3,8; 2,-1,0,-2,-5; -1,2,0,0,0");

photo
1

var ver=parseInt(ggbApplet.getVersion());

try{

if(ver== 5.0){

var A=prompt("Enter Tableau:","0,1,0,1,4; -5,4,2,6,15; -3,2,1,3,8; 2,-1,0,-2,-5; -1,2,0,0,0");

}else{

var A = "" + ggbApplet.getValueString("Tableau");

}

}catch(err){

alert("Error");

}finally{

alert("Version: "+ver);

}

photo
1

What if you try:

var A = "" + ggbApplet.getValueString("Tableau", true);?

(https://help.geogebra.org/topic/javascript-in-geogebra-classic-5-getvaluestringstring-2-parameter-nicht-mehr-optionalhttps://wiki.geogebra.org/e... > getValueString method)

© 2020 International GeoGebra Institute