|
August 8, 2000 The recalc() Method Tips: August 2000
Yehuda Shiran, Ph.D.
|
|
In JavaScript, you can force a recomputation by calling the Document Object's recalc() method:
In Column 65, Dynamic Properties, we showed how to program the Solar System. We need to trigger a recalculation because the expression we bound to the planets' parameters depends on the time in seconds passed from the initial loading of the page. The time give us a measure of the angle that the planet needs to complete. We need to find out how many seconds have passed every time interval, so we can update the angle (and the planet location) continuously. Here is the functional dependency between the angle and the time, as well as the planet's period length in days:
The planets'
We trigger the evaluation by calling the
where
For more on Dynamic Properties, go to Column 65, Dynamic Properties.
People who read this tip also read these tips: Look for similar tips by subject: |