Nutzung von JavaScript zur Anpassung und Steuerung der Simulation
1. Using buttons and Hyperlinks to control the simulation:
2. Eigene Methoden mit JavaScript erstellen:
function initialize() {
simulation.jsAddPointSource(50);
simulation.jsAddLens(150, 100);
simulation.jsAddLens(350,
200);
}
Note: Setting the initial conditions of the simulation by using JavaScript overrides existing parameter tags inside the applet tag.
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.