function searchSales()
{
var empID = $F('lstEmployees');
var y = $F('lstYears');
var url = 'http://yoursever/app/get_sales';
var pars = 'empID=' + empID + '&year=' + y;
var myAjax = new Ajax.Request( url, { method: 'get', parameters: pars,
onComplete: showResponse });
}
function showResponse(originalRequest)
{
//put returned XML in the textarea
$('result').value = originalRequest.responseText;
}
As you can see the showResponse function which is called when the request is
complete get a variable passed in. with that variable you can get the response
text as you see in the example above.
Jon Whitcraft
Web Application Developer
Online Services - Indianapolis Motor Speedway
(317) 492-8623
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Grzesiek Slusarek
Sent: Tuesday, March 07, 2006 4:11 AM
To: rails-spinoffs
Subject: [Rails-spinoffs] Ajax.Responders- how to get responseText?
Hi All. In my site I have situation that I always want to execute some piece of
code when AJAX call happen. I am using function onCreate and onComplete from
tutorial:http://www.sergiopereira.com/articles/prototype.js.html
but I don'k how to manipulate Ajax responseText in this function. Does anyone
know how to do it?
Gregor
----------------------------------------------------
Zagraj o tytuł Króla Strzelców i poczuj atmosferę Ligi Mistrzów:
http://klik.wp.pl/?adr=www.ligamistrzow.wp.pl&sid=688
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
********************
********************
This E-mail (and attachments) may contain confidential/privileged information
intended only for the named addressee(s). If you are not an intended recipient,
do not read, copy, disseminate or take any action based on the content of this
E-mail. Please notify the sender by reply E-mail and erase this E-mail from
your system. Your assistance is appreciated. E-mail transmission may not be
secure or error-free. The company is not responsible for any loss/damage
arising from any virus transmitted.
********************
********************
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs