Event handlers have to be functions.  When you write
'onreadystatechange = processStateChange(spanID);', the
processStateChange() function is *immediately* executed, and the
returned value is assigned to the event handler.  This works great if
your processStateChange returns a function, but if it returns (for
example) an int, there are problems.

Use an anonymous JavaScript function for your event handler:

function retrieveURL(name, spanID) {
  req.onreadystatechange = function() { processStateChange(spanID); };
}

On 6/21/05, Marc Demlenne <[EMAIL PROTECTED]> wrote:

> I'd like to have smthg like
> function retrieveURL(name, spanID) {
>       ...
>       req.onreadystatechange = processStateChange(spanID) ;
>       ...
> }
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to