On Mar 18, 2007, at 9:13 AM, Mislav Marohnić wrote:

> On 3/16/07, Colin Mollenhour <[EMAIL PROTECTED]> wrote:
> why can't Ajax.Request leave the parameters option a string if it  
> is passed a string?
>
> Then we would need to branch the logic around hacks into hacks for  
> strings and hacks for hashes---obviously not a good way to code.  
> String params are only for backwards compatibility, you really  
> should handle it with hashes. Using hashes internally in the  
> framework has slimmed down both Ajax params and Form serialization  
> code, and it should reduce the number of string hacks in user code,  
> also. It's also much nicer to look at.

I think Colin is right on this one.  There's no need to switch back  
and forth, or branch, as you suggest.

There is only a single instance that I found where Ajax modifies the  
params, and that's simulating other verbs over post. (ajax.js :  
87-91) The hash is converted to a query string two lines later.   
Simply don't make strings do the round trip, and move the  
Hash.toQueryString up a couple of lines.  The verb simulation can  
operate on a string.

Easy as pie, no hacks involved, and the code is smaller and faster.   
The only functional change is that "this.parameters" would remain in  
the same format it was passed in as, instead of always being a hash.



TAG





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@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-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to