[Javascript] IE onclick problem

David Dorward david at dorward.me.uk
Sat Apr 19 02:31:38 CDT 2008


On 19 Apr 2008, at 04:35, Troy III Ajnej wrote:
> Sorry, but
> > var capturedReturnValue = myFunction();
> just won't do! You are asigning the function to the var.

No, it is the return value of the function. If that was assigning the  
function it would be:

  var anotherRefToTheFunction = myFunction;

> It imediately calls the function execution and in casse it was
> referrenced from some other function as well, might end up
> in loop execution.

So don't write the script to call it in a recursive fashion.

> I still don't see how to utilize such a claim nor make it work.
> At least not by asigning a function to the var, because:
> >if (capturedReturnValue) {...
> will allways act as TRUE since it's not an empty strig.


The function can be written to return whatever you like, including on  
of the many things (not limited to empty strings) that are false values.

-- 
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/





More information about the Javascript mailing list