How to use JavaScript to Configure and Control the Simulation
You can use JavaScript methods to configure and control the simulation. This powerful and flexible way is explained in the following:
1. Using buttons and Hyperlinks to control the simulation:
2. Using JavaScript methods to create your own methods:
function initialize() {
simulation.jsSetDistance(250000);
simulation.jsSetEccentricity(0.3);
simulation.jsStart();
}
3. Creating your own exercises and problems:
In order to create your own exercise or problem, write your own function using the JavaScript methods provided by the simulation and launch it on the loading of the embedding web page. In order to do this, include the onload="JavaScript:initialize();" (or the name of any other function you have created and want to execute on loading of the page) parameter in the <body> tag of the embedding web page. You can find an example exercise in the exercise.html file.