[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Recursion in JavaScript



My name is Pavel Khramtsov

Help me please to answer on the following question:

What is happened when Navigator executes the following code:



function clock()
              {
               new_date = new Date()
               window.document.form1.f_clock.value = new_date.getSeconds()
               id = setTimeout("clock()",1000)
              }

<BODY onLoad="clock()">


Is it ordinal recursion or Navigator creates independent call of clock() 
after a second timeout?
Does Navigator create new new_date variable and how it utilize a memory
in this case?

There is a lot of pages with scripts. Some of them eats a lot of resources of
my computer that is operated by Windows 3.1. 

Thank`s,

          Pavel Khramtsov(dobr@kiae.su)