Posted By:
olorin_here
Posted On:
Friday, February 16, 2007 07:58 AM
I want to know whether there is a way to pass some arguments to the function that handles the "onreadystatechange" event. I want to assign the responseText to an attribute of the object that is received as an argument to the handler function. I am talking about something like this: .............. .............. .............. xhrObj.onreadystatechange = HandlerFunction(elementReference); .............. .............. .............. function HandlerFunction(elementReference) { if(re
More>>
I want to know whether there is a way to pass some arguments to the function that handles the "onreadystatechange" event.
I want to assign the responseText to an attribute of the object that is received as an argument to the handler function.
I am talking about something like this:
..............
..............
..............
xhrObj.onreadystatechange = HandlerFunction(elementReference);
..............
..............
..............
function HandlerFunction(elementReference)
{
if(readyState is appropriate)
{
elementReference.setAttribute("label",value");
}
}
Please let me know I can do something like this or there is a around this.
The purpose is this:
I have a set of similar elements. I collect them using
getElementsByTagName
Then I need to get the value of a particular attribute for each of the above elements, for which I place a XHR for each request. The problem is in assigning the right responseText to the proper element that it belongs to.
Any help would be great
Thank you
<<Less