For those interested, I figured out on my own how to do this:
blah: function(formalParameter)
{
// assume asyncInvoker is handling the XMLHTTPRequest details.
asyncInvoker('get', 'myurl.cfm?parameter=' + formalParameter, function(){
blahCallback(formalParameter)});
}
On 5/17/07, Eric Knipp <[EMAIL PROTECTED]> wrote:
I am still a bit of a n00b when it comes to advanced AJAX programming, and
I am running into a problem that I'm having a hard time figuring out. I've
already done a number of Googles to try and find a good solution, and I
think I need to do something with closures (another concept I don't know
that well - yet), but I am not sure how to bring this off.
Basically, I have an asynchronous XMLHTTPRequest, and when it completes I
have a callback function. The callback function needs access to a parameter
that is available only to the function that invoked the XMLHTTPRequest. The
only thing that comes back from the XMLHTTPRequest object is a status, and
that doesn't help me with what I am trying to do (although trapping that for
error handling is useful but outside of the scope of my question). Here is
some code:
blah: function(formalParameter)
{
// assume asyncInvoker is handling the XMLHTTPRequest details.
asyncInvoker('get', 'myurl.cfm?parameter=' + formalParameter,
blahCallback);
}
blahCallback: function(formalParameter)
{
// this is where I need to be able to get to formalParameter, but I am
not sure how.
doSomething(formalParameter);
}
Sorry that this is OT but I figure by now there is a lot of AJAX around...
Eric
_______________________________________________
Reply to DFWCFUG:
[email protected]
Subscribe/Unsubscribe:
http://lists1.safesecureweb.com/mailman/listinfo/list
List Archives:
http://www.mail-archive.com/list%40list.dfwcfug.org/
http://www.mail-archive.com/list%40dfwcfug.org/
DFWCFUG Sponsors:
www.instantspot.com/
www.teksystems.com/