[Prototype-core] Re: How to get the request parameters from the response?

2008-01-28 Thread Richard Quadling
The response object has a property of request. One issue I found. If there is an exception, the exception always gets the request object. http://dev.rubyonrails.org/ticket/9691 I've sent a patch which would add the response to the request (which is fed to the exception) to allow an exception

[Prototype-core] Re: How to get the request parameters from the response?

2008-01-27 Thread Tobie Langel
Try: new Ajax.Request(url, { parameters: { foo: 'hello world' }, onComplete: function(t) { alert(t.request.parameters.foo); } }); Best, Tobie On Jan 27, 11:12 pm, Gareth Evans [EMAIL PROTECTED] wrote: Someone correct me if i'm wrong but the parameters/postbody you sent do not

[Prototype-core] Re: How to get the request parameters from the response?

2008-01-27 Thread kangax
Gareth, new instance of Ajax.Response is passed as a first argument into a callback. That instance has request property which points to request object (the one that has all your settings/parameters, etc.). I don't really see a reason to do what you're doing. Best, kangax

[Prototype-core] Re: How to get the request parameters from the response?

2008-01-27 Thread Gareth Evans
I always thought the parameter to the callback was just the server reply (response) The docs show transport as a param, I didn't realise it was an instance of the request. Given this information, you're right, there's not a lot of sense to what i'm doing. After a quick spot of searching the API

[Prototype-core] Re: How to get the request parameters from the response?

2008-01-26 Thread kangax
var myRequest = new Ajax.Request('url', { parameters: { foo: 'bar', baz: 'qux' }, onComplete: function(transport) { var params = transport.request.parameters; // or var params = myRequest.parameters; } }) --~--~-~--~~~---~--~~ You

[Prototype-core] Re: How to get the request parameters from the response?

2008-01-26 Thread Tobie Langel
Hi, The request and transport objects are available as a property of the Ajax.Response object (the one passed to your parameters), as described here: http://prototypejs.org/api/ajax/response Best, Tobie On Jan 26, 9:34 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I am using