Best fit for this would be an inspect method. Have a look at the rest of the framework and at Ruby to see how this is generally implemented.
Best, Tobie On Nov 8, 4:09 pm, "jaap.taal" <[EMAIL PROTECTED]> wrote: > On Nov 7, 4:49 pm, kangax <[EMAIL PROTECTED]> wrote:> On Nov 7, 9:08 am, > "jaap.taal" <[EMAIL PROTECTED]> wrote: > > > > I'd like a toString method for an Ajax.Request object that can > > > identify the request for logging purposes. Right now I'm using the > > > following custom code: > > > > Ajax.Request.prototype.toString = function() { > > > if (this.method == 'get') { > > > And what if it's "PUT" or "DELETE"? > > I said "something like this" :) I'm not using PUT and DELETE in my > application, so this was enough for me. > > > > > > return this.url + "(GET)"; > > > } else { > > > return this.url + "?" + $H(this.parameters).toQueryString() + > > > "(POST)"; > > > } > > > > }; > > > > I think something like this ought to be in the prototype library. > > > I don't remember anyone proposing such thing : ) You can create a > > ticket (marking it as an enhancement) but I'm afraid what the output > > of `toString` should be is a pretty subjective decision. I think it's > > easy enough to write one (as you did) and "tailor" it to your specific > > need. > > > -- > > kangax --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---