Properties
Similar Topics
Statistics
Comments
9
Participants
2
Subscribers
3
Votes
1
Views
1250
Share
Answered
How to create, delete and selection object point , line, text using JavaScript window.
Pls share the attachment of results..
- GeoGebra
- Help
- Partners
-
Contact us
- Feedback & Questions
- This email address is being protected from spambots. You need JavaScript enabled to view it.
- +43 677 6137 2693
© 2023 International GeoGebra Institute
Reason: the whole string is composed of substrings and variables. ('A_' is a substring followed by a variable)
This form is suitable for maximum 0..9 (one digit)
.
The addlistener is not suitable for this purpose at all.
.
Note: the whole thing could also be done in GGB-Script.
Execute(Sequence("A_{"+(n-1)+"}=(random()*5, random()*5)",n,1,5))
1. Point onClick (JavaScript) of button using working fine .
getApplet.evalCommand("A = (2 , 3)")
2. But points are not creating using for loop onClick (JavaScript).
for (var i =0 ; i<5; i++) {
ggbApplet.evalCommand("A_'+i+' = (random()*5 , random()*5)"); \\ or
ggbApplet.evalCommand("A_'+i+' = (Math.random()*5 , Math.random()*5)"); \\
}
3. Also not working in Global JavaScript.
function ggbOnInit() {
ggbApplet.registerAddListener("myFn");
}
function myFn() {
for (var i; i <2; i++) {
ggbApplet.evalCommand("A_'+i+' = (random()*5 , random()*5)"); \\ or
ggbApplet.evalCommand("A_'+i+' = (Math.random()*5 , Math.random()*5)"); \\
}
}
Pls suggest solution for both as well.
Reason: the whole string is composed of substrings and variables. ('A_' is a substring followed by a variable)
This form is suitable for maximum 0..9 (one digit)
.
The addlistener is not suitable for this purpose at all.
.
Note: the whole thing could also be done in GGB-Script.
Execute(Sequence("A_{"+(n-1)+"}=(random()*5, random()*5)",n,1,5))
Comments have been locked on this page!