Hi,

HTML doesn't matter in POSTs, HTML is a browser concept.  POSTs are an
HTTP concept, which is a different layer and doesn't care about HTML.

POST data is URL-encoded (certain characters -- like percent signes --
turned into hex escapes, that sort of thing).

Prototype can handle it for you.  If you supply the data to post as an
object, Prototype will serialize and URL-encode it for you before
sending it, e.g.:

new Ajax.Request(url, {
    parameters: {
        'foo':  7,
        'bar':  'This is a <em>really cool</em> thing.'
    }
});

That anonymous object gets serialized, URL-encoded, and transmitted.
At the other end, whatever server-side software you're using will URL-
decode it and populate some sort of object with the fields
"foo" (value "7" -- everything arrives as a string) and "bar" (value
"This is a <em>really cool</em> thing.").  In transit, that string
will look quite different, but you don't have to worry about it
(unless you're looking at the underlying data for debugging reasons).

HTH,
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available


On Jul 29, 3:14 pm, jeremyrowe <[email protected]> wrote:
> I am trying to send postBody data through an Ajax.Request - The data
> contains html tags, and I am wondering what the best way to encode /
> decode the data so that I can make sure that the data is saved
> properly.
>
> Thanks
--~--~---------~--~----~------------~-------~--~----~
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