On Jun 28, 2006, at 12:00 PM, Scott Chapman wrote:

>
> I'm new to MochiKit and fairly new to Javascript also.  I'm  
> building a web
> application using GoogleMaps.  This little snippet of code is a  
> test to see if I
> can send a couple of map points to the server using JSON, have the  
> server turn
> them into Python objects and back to JSON strings and send them  
> back for
> plotting by GoogleMaps.  It is a proof of concept.
>
> I understand that loadJSONDoc is using GET to talk to the server,  
> which limits
> the amount of data you can submit.  How would you do this using POST?
>
> Is there a function/example of submitting a form using JSON format  
> to send the
> form contents?
>
> Is there a better way to do this:
>
> var points_send = []
> points_send.push({"lat":44.937585003910904,"lng":-122.991943359375})
> points_send.push({"lat":43.937585003910904,"lng":-122.991943359375})
>
> var url = '/map/' + serializeJSON(points_send) + '/map_points/';
> var myPoints = loadJSONDoc(url);
> myPoints.addCallbacks(processPoints,pointsFetchFailed);

JSON data is not safe for URL encoding, so you really can't correctly  
put it in a URL.

http://groups.google.com/group/mochikit/search?group=mochikit&q=post

-bob


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" 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/mochikit
-~----------~----~----~----~------~----~------~--~---

Reply via email to