Subj : Re: setTimeout Function To : netscape.public.mozilla.jseng From : =?ISO-8859-1?Q?Georg_Maa=DF?= Date : Tue Apr 29 2003 09:26 am Amit Lonkar wrote: > Hi All!! > > I am trying to run the following script :- > > print("This is a test message"); > > myfunction(); > > function myfunction() > { > print("Inside function"); > setTimeout("my()",1000); > } > > function my() > { > print("Function My Called"); > > return ; > } > > > > The above code throws the following exception:- > > Exception: "setTimeout" is not defined. > Exception in thread "main" > > Please let me know what could be the error > > Thanks > Amit Lonkar > > setTimeout is not a JavaScript function. setTimeout is a method of the Window object. If you run your script in an environment without Window object and in a context, without Window object in the scope chain, this will cause an error like that you got. .