No, you cannot pass a paremter the way you are trying...
req.onreadystatechange registers an event handler with the
XMLHttpRequest object, and it just takes a reference to a function.
The way to handle this is to set the span ID in a page-scope variable
that your state change handler will reference.
However, are you using my AjaxTags project for this? If so, what you
are trying to do is already supported, you simply use the stdInnerHTML
handler attached to the event you want on the form element you want.
Frank
Marc Demlenne wrote:
Hi all,
Using Ajax (with Struts, but it's not really a struts issue), is it
possible to use the function called "processStateChange" by Franck
with an argument ?
I would like to have one function beeing able to be used more times in
a page, updating different span zones according to the control who
called it.
Basically, in what Franck calls "retrieveURL", we have :
req.onreadystatechange = processStateChange ;
I'd like to have smthg like
function retrieveURL(name, spanID) {
...
req.onreadystatechange = processStateChange(spanID) ;
...
}
function processStateChange (spanID) {
...
document.getElementById("spanID").innerHTML = req.responseText;
...
}
But this won't work. What would be the correct way to implement this ?
Thanks a lot for any help !
--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]