[Proto-Scripty] Re: Encoding parameters in Ajax Request

2011-01-02 Thread T.J. Crowder
What does your actual Ajax.Request code look like? -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Jan 2, 5:40 am, kstubs wrote: > I'm passing a parameter string to parameter: of the Ajax.Request object.  My > string looks like: > > stamp=

[Proto-Scripty] Re: Encoding parameters in Ajax Request

2011-01-02 Thread kstubs
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(option

[Proto-Scripty] Re: Encoding parameters in Ajax Request

2011-01-02 Thread T.J. Crowder
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 se

[Proto-Scripty] Re: Encoding parameters in Ajax Request

2011-01-03 Thread kstubs
Hey, I'll try that! Didn't see the 1.7 announcement. -- 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-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to pr

[Proto-Scripty] Re: Encoding parameters in Ajax Request

2011-01-03 Thread kstubs
OK, testing 1.7 and am finding that my encoded parameter is being decoded with decodeURIComponent in toQueryParms: function toQueryParams(separator) { var match = this.strip().match(/([^?#]*)(#.*)?$/); if (!match) return { }; return match[1].split(separator || '&').inject({ }, func

[Proto-Scripty] Re: Encoding parameters in Ajax Request

2011-01-03 Thread kstubs
Follow up: walking through the code, where my value is decoded to: "Sr+16+", if I update (fix) the value back to "Sr+16%2b" and then send the request through, when I look at the Post values in the Console the value becomes: "Sr 16+". I'm not sure when the value becomes this, and this doesn't

[Proto-Scripty] Re: Encoding parameters in Ajax Request

2011-01-04 Thread Piotrek Reinmar Koszuliński
I can't undarstand one thing. How You encode Your original value to "Sr +16%2b"? Because when I use encodeURIComponent I get "%20Sr%2016%2B" which properly decodes to original value. EDIT: I read this topic second time and realised that the point is that it is prototype which encodes Your string a

[Proto-Scripty] Re: Encoding parameters in Ajax Request

2011-01-04 Thread T.J. Crowder
Hi, > OK, testing 1.7 and am finding that my encoded parameter is being decoded > with decodeURIComponent in toQueryParms: Yes, but as I said earlier, the decoded version *isn't used*. It's only decoded to check it (at least, that's my theory; they decode it without using the result, so...). I'm

[Proto-Scripty] Re: Encoding parameters in Ajax Request

2011-01-04 Thread kstubs
Hey TJ, I have walked Ajax#Request as you have and concur with your findings. On the backend is C#. The code is encoded like this: string val = System.Web.HttpUtility.UrlEncode(dr[m.GetAttribute("encode")].ToString().TrimEnd()); w.WriteAttributeString(m.GetAttribute("name").ToString()