Hi,

Ah yes, sorry, I forgot that Prototype's Ajax stuff used to mess
around with the strings you gave it.

> It would be nice if prototype could recognize that the string is properly
> encoded...
> Is this a possibility for future release of prototype?  Is this doable?

Good news! Prototype 1.7 sends the string unmolested. So if you update
to 1.7, you should be good to go. It still validates the string for
you (so if you pass in an *invalid* string, it will complain), but it
no longer does a round-trip from string to object back to string
before sending the params to the server. The string you provide the
actual one used.

HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com

On Jan 2, 4:09 pm, kstubs <[email protected]> wrote:
> Hi TJ, I've spent this morning walking through the code and have determined
> that prototype indeed calls the toQueryString() function when the original
> parameter is passed as type string.  For reference I'm here in the prototype
> code:  
>
> Ajax.Base = Class.create({
>     initialize: function(options) {
>         this.options = {
>             method: 'post',
>             asynchronous: true,
>             contentType: 'application/x-www-form-urlencoded',
>             encoding: 'UTF-8',
>             parameters: '',
>             evalJSON: true,
>             evalJS: true
>         };
>         Object.extend(this.options, options || {});
>
>         this.options.method = this.options.method.toLowerCase();
>
>         if (Object.isString(this.options.parameters))
>             this.options.parameters =
> this.options.parameters.toQueryParams();
>         else if (Object.isHash(this.options.parameters))
>             this.options.parameters = this.options.parameters.toObject();
>     }
>
> });
>
> So, since I need encoded arguments in my html I think it is best practice
> (in my case) to build my parameters as parameter object and not a string
> object (since the additional toQueryParams() method will be invoked on the
> string).  
> It would be nice if prototype could recognize that the string is properly
> encoded, since I am passing in a properly encoded string and don't require
> the additional toQueryParams() method on my string; this is a "leave it
> alone" case on the string.
>
> Is this a possibility for future release of prototype?  Is this doable?
>
> Karl..

-- 
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 [email protected].
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.

Reply via email to